From 455ca1326b32f19ccdd67dbd0e7b485e7ee15a39 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 20 Jun 2024 11:35:08 +0200 Subject: [PATCH] decodebin3: Fix detection of selection done We should not assert if there are still some old streams that are waiting to be deactivated. Instead wait for them to be gone before posting the selection done message Part-of: --- .../gst-plugins-base/gst/playback/gstdecodebin3.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 9cc2f9f9d1..1c0af469cf 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -3142,7 +3142,7 @@ is_selection_done (GstDecodebin3 * dbin) GST_DEBUG_OBJECT (dbin, "Selection active, creating message"); - /* We are completely active */ + /* All requested streams are present */ msg = gst_message_new_streams_selected ((GstObject *) dbin, collection->collection); @@ -3153,7 +3153,14 @@ is_selection_done (GstDecodebin3 * dbin) MultiQueueSlot *slot = tmp->data; if (slot->output) { GST_DEBUG_OBJECT (dbin, "Adding stream %s", slot->active_stream_id); - g_assert (stream_is_requested (dbin, slot->active_stream_id)); + if (!stream_is_requested (dbin, slot->active_stream_id)) { + /* We *could* still have an old output which isn't fully deactivated + * yet. Not 100% ready yet */ + GST_DEBUG_OBJECT (dbin, + "Stream from previous selection still active, bailing out"); + gst_message_unref (msg); + return NULL; + } gst_message_streams_selected_add (msg, slot->active_stream); } }