From 38ef12063d83246d3f7ba0152252088477925236 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 1 Apr 2021 14:41:11 -0400 Subject: [PATCH] webrtcbin: Make sure PC_LOCK is release when replying to promise Part-of: --- ext/webrtc/gstwebrtcbin.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index 3041294..4b28a10 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -759,6 +759,8 @@ _execute_op (GstWebRTCBinTask * op) { PC_LOCK (op->webrtc); if (op->webrtc->priv->is_closed) { + PC_UNLOCK (op->webrtc); + if (op->promise) { GError *error = g_error_new (GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_CLOSED, @@ -778,8 +780,9 @@ _execute_op (GstWebRTCBinTask * op) op->op (op->webrtc, op->data); -out: PC_UNLOCK (op->webrtc); + +out: return G_SOURCE_REMOVE; } @@ -5462,11 +5465,16 @@ _free_get_stats (struct get_stats *stats) static void _get_stats_task (GstWebRTCBin * webrtc, struct get_stats *stats) { + GstStructure *s; /* Our selector is the pad, * https://www.w3.org/TR/webrtc/#dfn-stats-selection-algorithm */ - gst_promise_reply (stats->promise, gst_webrtc_bin_create_stats (webrtc, - stats->pad)); + + s = gst_webrtc_bin_create_stats (webrtc, stats->pad); + + PC_UNLOCK (webrtc); + gst_promise_reply (stats->promise, s); + PC_LOCK (webrtc); } static void -- 2.7.4