From 726f2d8dc0e9fb90f182cbfbbda1935afd29ccc9 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 11 Apr 2024 15:19:50 +0200 Subject: [PATCH] adaptivedemux2: Only set DISCONT on beginning of fragments This avoids accidentally setting it in the middle of a fragment, which could cause havoc in demuxer/parsers Part-of: --- .../ext/adaptivedemux2/gstadaptivedemux-stream.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c index 7bee9fcd45..cabc13d5cd 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c @@ -648,15 +648,15 @@ gst_adaptive_demux2_stream_push_buffer (GstAdaptiveDemux2Stream * stream, if (demux->have_group_id) gst_event_set_group_id (stream_start, demux->group_id); } + stream->first_fragment_buffer = FALSE; + + if (stream->discont) { + discont = TRUE; + stream->discont = FALSE; + } } else { GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE; } - stream->first_fragment_buffer = FALSE; - - if (stream->discont) { - discont = TRUE; - stream->discont = FALSE; - } if (discont) { GST_DEBUG_OBJECT (stream, "Marking fragment as discontinuous");