adaptivedemux2: Ignore stopped stream flow state
authorJan Schmidt <jan@centricular.com>
Tue, 28 Jun 2022 14:51:28 +0000 (00:51 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 29 Jun 2022 15:35:26 +0000 (16:35 +0100)
When calculating the combined stream flow state
for a period, don't consider stopped streams.

Fixes switching to the next period in DASH streams
with multiple video/audio/subtitle streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2684>

subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c

index 7c1fc3fa2c2b78a8e65ebd79fff839d7714bffdf..405631ed8bc7ec5a12e5488a6120c24649e4e051 100644 (file)
@@ -239,6 +239,11 @@ 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)
+      continue;
+
     if (stream->last_ret != GST_FLOW_NOT_LINKED) {
       all_notlinked = FALSE;
       if (stream->last_ret != GST_FLOW_EOS)