mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
matroskademux: fix decoder glitches with H264 content
To avoid decoder starvation causing glitches on screen, the demuxer shall clip only when the buffer is a key frame and the lace time is greater than the stop time. Fixes gst-editing-services#128 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/973>
This commit is contained in:
parent
c75bd32539
commit
918d882021
1 changed files with 8 additions and 4 deletions
|
@ -4799,11 +4799,15 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
if (GST_CLOCK_TIME_IS_VALID (lace_time)) {
|
if (GST_CLOCK_TIME_IS_VALID (lace_time)) {
|
||||||
GstClockTime last_stop_end;
|
GstClockTime last_stop_end;
|
||||||
|
|
||||||
/* Check if this stream is after segment stop */
|
/* Check if this stream is after segment stop,
|
||||||
if (GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop) &&
|
* but only terminate if we hit the next keyframe,
|
||||||
lace_time >= demux->common.segment.stop) {
|
* to make sure that all frames potentially inside the segment
|
||||||
|
* are available to the decoder for decoding / reordering.*/
|
||||||
|
if (!delta_unit && GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop)
|
||||||
|
&& lace_time >= demux->common.segment.stop) {
|
||||||
GST_DEBUG_OBJECT (demux,
|
GST_DEBUG_OBJECT (demux,
|
||||||
"Stream %d after segment stop %" GST_TIME_FORMAT, stream->index,
|
"Stream %d lace time: %" GST_TIME_FORMAT " after segment stop: %"
|
||||||
|
GST_TIME_FORMAT, stream->index, GST_TIME_ARGS (lace_time),
|
||||||
GST_TIME_ARGS (demux->common.segment.stop));
|
GST_TIME_ARGS (demux->common.segment.stop));
|
||||||
gst_buffer_unref (sub);
|
gst_buffer_unref (sub);
|
||||||
goto eos;
|
goto eos;
|
||||||
|
|
Loading…
Reference in a new issue