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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
This commit is contained in:
Edward Hervey 2022-10-19 11:00:09 +02:00 committed by GStreamer Marge Bot
parent 3305d7ce8d
commit 586ec1a672

View file

@ -2320,12 +2320,10 @@ setup_source (GstURISourceBin * urisrc)
/* source provides raw data, we added the pads and we can now signal a
* 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 */