mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
inputselector: Avoid deadlock when requesting pads
The deadlock was the following: * One thread requests a new pad, the internal lock is kept while adding the pad * Another thread (or the same one) requests the internal links of a pad (could be that pad)... which also requires that lock. That internal lock is not required when adding the pad to the element (which is the last action when requesting a new pad). The fact it will be actually used will be *after* the request pad function is released. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/512>
This commit is contained in:
parent
cc87357105
commit
f2478618b5
1 changed files with 1 additions and 1 deletions
|
@ -1813,8 +1813,8 @@ gst_input_selector_request_new_pad (GstElement * element,
|
||||||
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_CAPS);
|
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_CAPS);
|
||||||
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_ALLOCATION);
|
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_ALLOCATION);
|
||||||
gst_pad_set_active (sinkpad, TRUE);
|
gst_pad_set_active (sinkpad, TRUE);
|
||||||
gst_element_add_pad (GST_ELEMENT (sel), sinkpad);
|
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
|
gst_element_add_pad (GST_ELEMENT (sel), sinkpad);
|
||||||
|
|
||||||
return sinkpad;
|
return sinkpad;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue