From f33fe73bb7a55486847f738f0c3d375b8cb93fb9 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 1 Jul 2022 02:05:36 +1000 Subject: [PATCH] adaptivedemux2: Check stream selected instead of state When combining stream flows, ignore streams that are not selected, instead of checking whether the stream state has changed yet. Fixes another issue with dashdemux2 where it fails to change to the next period when playing content with several video, audio and text streams, as with Manifest_MultiPeriod_1080p.mpd when seeking to 730 just before the end of the first period. Part-of: --- .../ext/adaptivedemux2/gstadaptivedemux-period.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c index 405631ed8b..412b551af2 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c @@ -239,9 +239,9 @@ gst_adaptive_demux_period_combine_stream_flows (GstAdaptiveDemuxPeriod * period) for (iter = period->streams; iter; iter = g_list_next (iter)) { GstAdaptiveDemux2Stream *stream = iter->data; - /* Streams that are not running do not contribute - * to the flow */ - if (stream->state == GST_ADAPTIVE_DEMUX2_STREAM_STATE_STOPPED) + /* Streams that are not running do not contribute to the flow, + * so ignore streams with no selected tracks */ + if (!gst_adaptive_demux2_stream_is_selected (stream)) continue; if (stream->last_ret != GST_FLOW_NOT_LINKED) {