mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
splitmuxsrc: Drop lock when unpreparing parts
Parts may emit bus messages that want to take the splitmuxsrc lock and prevent the downward state change. Avoid a deadlock after a part sends an error message by taking a ref and dropping the lock around the unprepare call Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7053>
This commit is contained in:
parent
ec1c6c5b60
commit
8a1fab9594
1 changed files with 9 additions and 2 deletions
|
@ -1306,7 +1306,13 @@ gst_splitmux_src_stop (GstSplitMuxSrc * splitmux)
|
||||||
for (i = 0; i < splitmux->num_parts; i++) {
|
for (i = 0; i < splitmux->num_parts; i++) {
|
||||||
if (splitmux->parts[i] == NULL)
|
if (splitmux->parts[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
gst_splitmux_part_reader_unprepare (splitmux->parts[i]);
|
|
||||||
|
/* Take a ref so we can drop the lock around calling unprepare */
|
||||||
|
GstSplitMuxPartReader *part = g_object_ref (splitmux->parts[i]);
|
||||||
|
SPLITMUX_SRC_UNLOCK (splitmux);
|
||||||
|
gst_splitmux_part_reader_unprepare (part);
|
||||||
|
g_object_unref (part);
|
||||||
|
SPLITMUX_SRC_LOCK (splitmux);
|
||||||
}
|
}
|
||||||
|
|
||||||
SPLITMUX_SRC_PADS_WLOCK (splitmux);
|
SPLITMUX_SRC_PADS_WLOCK (splitmux);
|
||||||
|
@ -1946,10 +1952,11 @@ do_lookahead_check (GstSplitMuxSrc * splitmux)
|
||||||
i, reader, splitmux->cur_part);
|
i, reader, splitmux->cur_part);
|
||||||
gst_object_ref (reader);
|
gst_object_ref (reader);
|
||||||
add_to_active_readers (splitmux, reader, FALSE);
|
add_to_active_readers (splitmux, reader, FALSE);
|
||||||
SPLITMUX_SRC_UNLOCK (splitmux);
|
|
||||||
|
|
||||||
/* Drop lock before calling activate, as it might call back
|
/* Drop lock before calling activate, as it might call back
|
||||||
* into the splitmuxsrc when exposing pads */
|
* into the splitmuxsrc when exposing pads */
|
||||||
|
SPLITMUX_SRC_UNLOCK (splitmux);
|
||||||
|
|
||||||
gst_splitmux_part_reader_prepare (reader);
|
gst_splitmux_part_reader_prepare (reader);
|
||||||
gst_object_unref (reader);
|
gst_object_unref (reader);
|
||||||
/* Only prepare one part at a time */
|
/* Only prepare one part at a time */
|
||||||
|
|
Loading…
Reference in a new issue