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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
This commit is contained in:
Jan Schmidt 2024-07-12 10:44:51 +10:00
parent 44005ab9fb
commit ec1c6c5b60

View file

@ -1046,6 +1046,7 @@ add_to_active_readers (GstSplitMuxSrc * splitmux,
} }
} }
/* Called with splitmuxsrc lock held */
static gboolean static gboolean
gst_splitmux_src_activate_part (GstSplitMuxSrc * splitmux, guint part, gst_splitmux_src_activate_part (GstSplitMuxSrc * splitmux, guint part,
GstSeekFlags extra_flags) GstSeekFlags extra_flags)
@ -1062,6 +1063,8 @@ gst_splitmux_src_activate_part (GstSplitMuxSrc * splitmux, guint part,
if (!gst_splitmux_part_reader_activate (reader, if (!gst_splitmux_part_reader_activate (reader,
&splitmux->play_segment, extra_flags)) { &splitmux->play_segment, extra_flags)) {
gst_object_unref (reader); gst_object_unref (reader);
/* Re-take the lock before exiting */
SPLITMUX_SRC_LOCK (splitmux);
return FALSE; return FALSE;
} }
gst_object_unref (reader); gst_object_unref (reader);