From 586ec1a67277403e1ab4def413e4e58d67dc00e1 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 19 Oct 2022 11:00:09 +0200 Subject: [PATCH] urisourcebin: Error out if a source doesn't expose pads Looks like this fell through the cracks. If a source element doesn't have dynamic pads and doesn't provide any source pad ... we should properly error out. Part-of: --- subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c index 9161a07..abbad53 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c @@ -2321,11 +2321,9 @@ setup_source (GstURISourceBin * urisrc) * no_more pads because we are done. */ gst_element_no_more_pads (GST_ELEMENT_CAST (urisrc)); return TRUE; - } else if (!have_out) { - GST_DEBUG_OBJECT (urisrc, "Source has no output pads"); - - return TRUE; } + if (!have_out) + goto no_pads; } else { GST_DEBUG_OBJECT (urisrc, "Source has dynamic output pads"); /* connect a handler for the new-pad signal */ @@ -2392,6 +2390,12 @@ invalid_source: (_("Source element is invalid.")), (NULL)); return FALSE; } +no_pads: + { + GST_ELEMENT_ERROR (urisrc, CORE, FAILED, + (_("Source element has no pads.")), (NULL)); + return FALSE; + } streaming_failed: { /* message was posted */ -- 2.7.4