mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
videodecoder: Avoid pushing buffers before segment start
In the case where the stream doesn't have a framerate set and the frames don't have a duration set, we still want to use the clipping path to make sure we don't push buffers outside of the segment. The problem was the previous iteration was setting a duration of 2s, which meant that any buffer which was less than 2s before the segment start would end up getting pushed. Instead, use a saner 40ms (25fps single frame duration) to figure out whether the frame could be within the segment or not
This commit is contained in:
parent
4ed7b0a0e6
commit
d34aaf9e9b
1 changed files with 7 additions and 7 deletions
|
@ -3128,16 +3128,16 @@ gst_video_decoder_clip_and_push_buf (GstVideoDecoder * decoder, GstBuffer * buf)
|
||||||
stop = start + duration;
|
stop = start + duration;
|
||||||
} else if (GST_CLOCK_TIME_IS_VALID (start)
|
} else if (GST_CLOCK_TIME_IS_VALID (start)
|
||||||
&& !GST_CLOCK_TIME_IS_VALID (duration)) {
|
&& !GST_CLOCK_TIME_IS_VALID (duration)) {
|
||||||
/* 2 second frame duration is rather unlikely... but if we don't clip
|
/* If we don't clip away buffers that far before the segment we
|
||||||
* away buffers that far before the segment we can cause the pipeline to
|
* can cause the pipeline to lockup. This can happen if audio is
|
||||||
* lockup. This can happen if audio is properly clipped, and thus the
|
* properly clipped, and thus the audio sink does not preroll yet
|
||||||
* audio sink does not preroll yet but the video sink prerolls because
|
* but the video sink prerolls because we already outputted a
|
||||||
* we already outputted a buffer here... and then queues run full.
|
* buffer here... and then queues run full.
|
||||||
*
|
*
|
||||||
* In the worst case we will clip one buffer too many here now if no
|
* In the worst case we will clip one buffer too many here now if no
|
||||||
* framerate is given, no buffer duration is given and the actual
|
* framerate is given, no buffer duration is given and the actual
|
||||||
* framerate is less than 0.5fps */
|
* framerate is lower than 25fps */
|
||||||
stop = start + 2 * GST_SECOND;
|
stop = start + 40 * GST_MSECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
segment = &decoder->output_segment;
|
segment = &decoder->output_segment;
|
||||||
|
|
Loading…
Reference in a new issue