libs/gst/base/gstbasesink.c: Use new API to get elapsed time.

Original commit message from CVS:
* libs/gst/base/gstbasesink.c:
Use new API to get elapsed time.
This commit is contained in:
Stefan Kost 2007-11-28 13:02:30 +00:00
parent c437e3b4e2
commit 8e2d76084f
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2007-11-28 Stefan Kost <ensonic@users.sf.net>
* libs/gst/base/gstbasesink.c:
Use new API to get elapsed time.
2007-11-28 Stefan Kost <ensonic@users.sf.net> 2007-11-28 Stefan Kost <ensonic@users.sf.net>
* gst/gstdebugutils.c: * gst/gstdebugutils.c:

View file

@ -189,7 +189,7 @@ struct _GstBaseSinkPrivate
* buffers. */ * buffers. */
GstClockTime last_left_systime; GstClockTime last_left_systime;
GstClockTime avg_jitter; GstClockTime avg_jitter;
GTimeVal start, stop; GstClockTime start, stop;
GstClockTime avg_render; GstClockTime avg_render;
/* number of rendered and dropped frames */ /* number of rendered and dropped frames */
@ -1969,14 +1969,13 @@ gst_base_sink_do_render_stats (GstBaseSink * basesink, gboolean start)
priv = basesink->priv; priv = basesink->priv;
if (start) { if (start) {
g_get_current_time (&priv->start); GST_GET_TIMESTAMP (priv->start);
} else { } else {
GstClockTime elapsed; GstClockTime elapsed;
g_get_current_time (&priv->stop); GST_GET_TIMESTAMP (priv->stop);
elapsed = elapsed = GST_CLOCK_DIFF (priv->start, priv->stop);
GST_TIMEVAL_TO_TIME (priv->stop) - GST_TIMEVAL_TO_TIME (priv->start);
if (priv->avg_render == -1) if (priv->avg_render == -1)
priv->avg_render = elapsed; priv->avg_render = elapsed;