summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2023-05-02 18:14:20 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-03 09:54:11 +0000
commit0a23782aeaeed41c4605783f922c0bcc4fe0208d (patch)
tree1566906872c8caf82118dfd8efb0f3f82eea1858
parent943a53cc515d3aa43df3a441865af256bd61a48d (diff)
downloadgstreamer-0a23782aeaeed41c4605783f922c0bcc4fe0208d.tar.gz
webrtcbin: Fix potential deadlock when closing before any data was sent
A blocking pad probe is added on new sink pads, it's usually removed after the caps have been negotiated or the signaling state switched to stable, but if that never happens and the pad is released we kept the pad probe active, leaving the pad blocked, preventing clean disposal. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4533>
-rw-r--r--subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
index 6a8f722364..8929fef3d0 100644
--- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
+++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
@@ -8184,6 +8184,11 @@ gst_webrtc_bin_release_pad (GstElement * element, GstPad * pad)
gst_caps_replace (&webrtc_pad->received_caps, NULL);
PC_UNLOCK (webrtc);
+ if (webrtc_pad->block_id) {
+ gst_pad_remove_probe (GST_PAD (pad), webrtc_pad->block_id);
+ webrtc_pad->block_id = 0;
+ }
+
_remove_pad (webrtc, webrtc_pad);
PC_LOCK (webrtc);