From: <thi...@ke...> - 2010-09-24 11:54:23
|
Module: gst-plugins-bad Branch: master Commit: 4ebdd9b5acebc79634c4cc5d2956a489e45df823 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=4ebdd9b5acebc79634c4cc5d2956a489e45df823 Author: Lasse Laukkanen <ext...@no...> Date: Thu Sep 23 14:15:08 2010 +0300 fpsdisplaysink: initialize interval_ts and last_frames_* counters Initialize interval_ts to first QOS event timestamp, otherwise the fps statistics are printed always after one rendered frame. Also, initialize last_frames_* counters, the values are bogus e.g. after PLAYING-NULL-PLAYING state change. --- gst/debugutils/fpsdisplaysink.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gst/debugutils/fpsdisplaysink.c b/gst/debugutils/fpsdisplaysink.c index e90ac19..aca421c 100644 --- a/gst/debugutils/fpsdisplaysink.c +++ b/gst/debugutils/fpsdisplaysink.c @@ -224,7 +224,7 @@ on_video_sink_data_flow (GstPad * pad, GstMiniObject * mini_obj, ts = gst_util_get_timestamp (); if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (self->start_ts))) { - self->last_ts = self->start_ts = ts; + self->interval_ts = self->last_ts = self->start_ts = ts; } if (GST_CLOCK_DIFF (self->interval_ts, ts) > self->fps_update_interval) { display_current_fps (self); @@ -404,6 +404,8 @@ fps_display_sink_start (GstFPSDisplaySink * self) /* Init counters */ self->frames_rendered = G_GUINT64_CONSTANT (0); self->frames_dropped = G_GUINT64_CONSTANT (0); + self->last_frames_rendered = G_GUINT64_CONSTANT (0); + self->last_frames_dropped = G_GUINT64_CONSTANT (0); self->max_fps = -1; self->min_fps = -1; |