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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7074>
This commit is contained in:
Edward Hervey 2024-06-20 11:35:08 +02:00 committed by Backport Bot
parent a58953cbf6
commit 455ca1326b

View file

@ -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);
}
}