mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-24 06:56:26 +00:00
uridecodebin3: Don't hold play items lock while activating source items
Activating them can cause messages that call back into the message handler of uridecodebin3 and take exactly the same lock again. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8215>
This commit is contained in:
parent
f902f70659
commit
fb34f63835
1 changed files with 7 additions and 0 deletions
|
@ -972,6 +972,7 @@ activate_source_item (GstSourceItem * item)
|
||||||
return GST_STATE_CHANGE_SUCCESS;
|
return GST_STATE_CHANGE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* PLAY_ITEMS_LOCK held */
|
||||||
static void
|
static void
|
||||||
link_src_pad_to_db3 (GstURIDecodeBin3 * uridecodebin, GstSourcePad * spad)
|
link_src_pad_to_db3 (GstURIDecodeBin3 * uridecodebin, GstSourcePad * spad)
|
||||||
{
|
{
|
||||||
|
@ -1005,6 +1006,10 @@ link_src_pad_to_db3 (GstURIDecodeBin3 * uridecodebin, GstSourcePad * spad)
|
||||||
&& !handler->play_item->sub_item->handler) {
|
&& !handler->play_item->sub_item->handler) {
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
|
/* Temporarily release play items lock to avoid deadlock if activating the
|
||||||
|
* source item causes a message that calls back into our message handler */
|
||||||
|
PLAY_ITEMS_UNLOCK (uridecodebin);
|
||||||
|
|
||||||
/* The state lock is taken to ensure we can atomically change the
|
/* The state lock is taken to ensure we can atomically change the
|
||||||
* urisourcebin back to NULL in case of failures */
|
* urisourcebin back to NULL in case of failures */
|
||||||
GST_STATE_LOCK (uridecodebin);
|
GST_STATE_LOCK (uridecodebin);
|
||||||
|
@ -1016,9 +1021,11 @@ link_src_pad_to_db3 (GstURIDecodeBin3 * uridecodebin, GstSourcePad * spad)
|
||||||
FALSE);
|
FALSE);
|
||||||
handler->play_item->sub_item->handler = NULL;
|
handler->play_item->sub_item->handler = NULL;
|
||||||
GST_STATE_UNLOCK (uridecodebin);
|
GST_STATE_UNLOCK (uridecodebin);
|
||||||
|
PLAY_ITEMS_LOCK (uridecodebin);
|
||||||
goto sub_item_activation_failed;
|
goto sub_item_activation_failed;
|
||||||
}
|
}
|
||||||
GST_STATE_UNLOCK (uridecodebin);
|
GST_STATE_UNLOCK (uridecodebin);
|
||||||
|
PLAY_ITEMS_LOCK (uridecodebin);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue