mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
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.
This commit is contained in:
parent
7315a07bc8
commit
c1bd6677c6
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue