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/7069>
This commit is contained in:
Edward Hervey 2024-06-20 11:35:08 +02:00 committed by GStreamer Marge Bot
parent bdb12db5c6
commit 6aa0c8442d

View file

@ -3168,7 +3168,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);
@ -3179,7 +3179,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);
}
}