interleave: Don't hold object lock while querying caps downstream

This can easily lead to deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8933>
This commit is contained in:
Sebastian Dröge 2025-05-06 12:41:37 +03:00 committed by GStreamer Marge Bot
parent 352a8a8b12
commit b461115699

View File

@ -732,7 +732,10 @@ gst_interleave_sink_getcaps (GstPad * pad, GstInterleave * self,
/* If we already have caps on one of the sink pads return them */
if (self->sinkcaps) {
result = gst_caps_copy (self->sinkcaps);
GST_OBJECT_UNLOCK (self);
} else {
GST_OBJECT_UNLOCK (self);
/* get the downstream possible caps */
peercaps = gst_pad_peer_query_caps (self->src, NULL);
@ -756,8 +759,6 @@ gst_interleave_sink_getcaps (GstPad * pad, GstInterleave * self,
__set_channels (result, 1);
}
GST_OBJECT_UNLOCK (self);
if (filter != NULL) {
GstCaps *caps = result;