urisourcebin: Cleanup on failure
authorEdward Hervey <edward@centricular.com>
Fri, 13 Jan 2023 15:39:51 +0000 (16:39 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 13 Jan 2023 15:41:53 +0000 (16:41 +0100)
This ensures there is a source present/valid *ONLY* in PAUSED and above.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3720>

subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c

index b8366ec..f108caf 100644 (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;
   }
 }