summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2023-01-13 16:39:51 +0100
committerEdward Hervey <bilboed@bilboed.com>2023-01-13 16:41:53 +0100
commit13ad8c8e4e2101c5a50c9e9232187b3ebf29f04d (patch)
treec7665887a34c6cb8757943908cb9b4bb8f9b31b2
parent1546ab0d0f6740708a868b59c301e543e16dcce5 (diff)
downloadgstreamer-13ad8c8e4e2101c5a50c9e9232187b3ebf29f04d.tar.gz
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>
-rw-r--r--subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c
index b8366ecc64..f108caf344 100644
--- a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c
+++ b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c
@@ -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;
}
}