uridecodebin3: Don't hold play items lock while releasing pads

Releasing the pad can cause messages that call back into the message
handler of uridecodebin3 and take exactly the same lock again.

Fix #4443

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9032>
This commit is contained in:
Guillaume Desmottes 2025-05-20 08:21:51 +02:00 committed by GStreamer Marge Bot
parent 7ffbb1ce34
commit 8f627b1f9c

View File

@ -1128,8 +1128,12 @@ switch_and_activate_input_locked (GstURIDecodeBin3 * uridecodebin,
GstSourcePad *old_spad = iterold->data;
if (old_spad->db3_sink_pad) {
GST_DEBUG_OBJECT (uridecodebin, "Releasing no longer used db3 pad");
/* Temporarily release play items lock to avoid deadlock if releasing the
* pad causes a message that calls back into our message handler. */
PLAY_ITEMS_UNLOCK (uridecodebin);
gst_element_release_request_pad (uridecodebin->decodebin,
old_spad->db3_sink_pad);
PLAY_ITEMS_LOCK (uridecodebin);
old_spad->db3_sink_pad = NULL;
}
}