Commit c1bd6677 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

basesink: Use the average durations based on timestamps for the QoS proportion...

basesink: Use the average durations based on timestamps for the QoS proportion when doing trickmodes

The durations of the buffers are (usually) assuming that no frames are being
dropped and are just the durations coming from the stream. However if we do
trickmodes, frames are being dropped regularly especially if only key units
are supposed to be played.

Fixes completely bogus QoS proportion values in the above case.
parent 7315a07b
......@@ -2668,8 +2668,13 @@ gst_base_sink_perform_qos (GstBaseSink * sink, gboolean dropped)
left = start + jitter;
}
/* calculate duration of the buffer */
if (GST_CLOCK_TIME_IS_VALID (stop) && stop != start)
/* calculate duration of the buffer, only use buffer durations if not in
* trick mode or key-unit mode. Otherwise the buffer durations will be
* meaningless as frames are being dropped in-between without updating the
* durations. */
if (GST_CLOCK_TIME_IS_VALID (stop)
&& !(sink->segment.flags & (GST_SEGMENT_FLAG_TRICKMODE |
GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS)) && stop != start)
duration = stop - start;
else
duration = priv->avg_in_diff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment