From 73152b53ff8f51fceb7570a09705c76dd95ae4d8 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 11 Mar 2024 09:16:01 +0100 Subject: [PATCH] decodebin3: Provide clear error message if no decoders present If we don't do this we will end up with a more cryptic error message (not-linked error from some upstream component). Fixes #3198 Part-of: --- subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 09acb65c99..b0af4f8bb0 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -2424,15 +2424,20 @@ check_slot_reconfiguration (GstDecodebin3 * dbin, MultiQueueSlot * slot) } if (!reconfigure_output_stream (output, slot, &msg)) { + gboolean no_more_streams; GST_DEBUG_OBJECT (dbin, "Removing failing stream from selection: %s ", gst_stream_get_stream_id (slot->active_stream)); slot->dbin->requested_selection = remove_from_list (slot->dbin->requested_selection, gst_stream_get_stream_id (slot->active_stream)); + no_more_streams = slot->dbin->requested_selection == NULL; dbin->selection_updated = TRUE; SELECTION_UNLOCK (dbin); if (msg) gst_element_post_message ((GstElement *) slot->dbin, msg); + if (no_more_streams) + GST_ELEMENT_ERROR (slot->dbin, CORE, MISSING_PLUGIN, (NULL), + ("no suitable plugins found")); reassign_slot (dbin, slot); } else { GstMessage *selection_msg = is_selection_done (dbin); @@ -3062,7 +3067,10 @@ reconfigure_output_stream (DecodebinOutputStream * output, missing_decoder: { GstCaps *caps; + caps = gst_stream_get_caps (slot->active_stream); + GST_DEBUG_OBJECT (slot->src_pad, + "We are missing a decoder for %" GST_PTR_FORMAT, caps); *msg = gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps); gst_caps_unref (caps); }