diff options
author | Lasse Laukkanen <ext-lasse.2.laukkanen@nokia.com> | 2010-09-23 14:15:08 +0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-09-24 08:21:00 -0300 |
commit | 4ebdd9b5acebc79634c4cc5d2956a489e45df823 (patch) | |
tree | d317db36d2a7cba87fd6312948c2e5d65dbc6f6f /gst/debugutils | |
parent | a6b26cac6585db67b46fd0d105483919704e0670 (diff) | |
download | gstreamer-plugins-bad-4ebdd9b5acebc79634c4cc5d2956a489e45df823.tar.gz |
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.
Diffstat (limited to 'gst/debugutils')
-rw-r--r-- | 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 e90ac191c..aca421ce6 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; |