From ec1c6c5b6041764be372b4ec003b947e2aee8cb5 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 12 Jul 2024 10:44:51 +1000 Subject: [PATCH] splitmuxsrc: Make sure to re-take lock In the error path when activating a part fails, make sure to re-take the splitmuxsrc lock before returning to the caller. Part-of: --- subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c index 581c887a18..1e18da8de6 100644 --- a/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c +++ b/subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c @@ -1046,6 +1046,7 @@ add_to_active_readers (GstSplitMuxSrc * splitmux, } } +/* Called with splitmuxsrc lock held */ static gboolean gst_splitmux_src_activate_part (GstSplitMuxSrc * splitmux, guint part, GstSeekFlags extra_flags) @@ -1062,6 +1063,8 @@ gst_splitmux_src_activate_part (GstSplitMuxSrc * splitmux, guint part, if (!gst_splitmux_part_reader_activate (reader, &splitmux->play_segment, extra_flags)) { gst_object_unref (reader); + /* Re-take the lock before exiting */ + SPLITMUX_SRC_LOCK (splitmux); return FALSE; } gst_object_unref (reader);