summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc0120f)
raw | patch | inline | side by side (parent: dc0120f)
author | Wim Taymans <wim.taymans@collabora.co.uk> | |
Mon, 14 Feb 2011 12:47:02 +0000 (13:47 +0100) | ||
committer | Wim Taymans <wim.taymans@collabora.co.uk> | |
Mon, 14 Feb 2011 14:17:44 +0000 (15:17 +0100) |
Improve the calculation of the duration. When we have no input duration set on
the input buffers stop is set to start and then we end up using a 0 duration in
the average calculation.
the input buffers stop is set to start and then we end up using a 0 duration in
the average calculation.
libs/gst/base/gstbasesink.c | patch | blob | history |
index e8eb5981e048f98fb9b1e749c25b9dcd13bcb525..cc5a99fb2a7ceb29c40da8200a228915a00a26fc 100644 (file)
}
/* calculate duration of the buffer */
- if (GST_CLOCK_TIME_IS_VALID (stop))
+ if (GST_CLOCK_TIME_IS_VALID (stop) && stop != start)
duration = stop - start;
else
duration = GST_CLOCK_TIME_NONE;
}
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "start: %" GST_TIME_FORMAT
- ", entered %" GST_TIME_FORMAT ", left %" GST_TIME_FORMAT ", pt: %"
- GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT ",jitter %"
- G_GINT64_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (entered),
- GST_TIME_ARGS (left), GST_TIME_ARGS (pt), GST_TIME_ARGS (duration),
- jitter);
+ ", stop %" GST_TIME_FORMAT ", entered %" GST_TIME_FORMAT ", left %"
+ GST_TIME_FORMAT ", pt: %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT
+ ",jitter %" G_GINT64_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
+ GST_TIME_ARGS (entered), GST_TIME_ARGS (left), GST_TIME_ARGS (pt),
+ GST_TIME_ARGS (duration), jitter);
GST_CAT_DEBUG_OBJECT (GST_CAT_QOS, sink, "avg_duration: %" GST_TIME_FORMAT
", avg_pt: %" GST_TIME_FORMAT ", avg_rate: %g",