urisourcebin: Cleanup on failure

This ensures there is a source present/valid *ONLY* in PAUSED and above.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3720>
This commit is contained in:
Edward Hervey 2023-01-13 16:39:51 +01:00 committed by Edward Hervey
parent 1546ab0d0f
commit 13ad8c8e4e

View file

@ -3014,11 +3014,13 @@ gst_uri_source_bin_change_state (GstElement * element,
/* ERRORS */
source_failed:
{
remove_source (urisrc);
return GST_STATE_CHANGE_FAILURE;
}
setup_failed:
{
/* clean up leftover groups */
if (transition == GST_STATE_CHANGE_READY_TO_PAUSED)
remove_source (urisrc);
return GST_STATE_CHANGE_FAILURE;
}
}