From 39f2afbd45fe207218816f0bca3ccfc063ce1b47 Mon Sep 17 00:00:00 2001 From: sergey radionov Date: Sun, 4 Feb 2024 22:06:09 +0700 Subject: [PATCH] webrtcbin: it's better to have thread default main context on thread bound to that main context. fixes #3271 Part-of: --- subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index a38ff85ef6..0d72d581d8 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -1110,10 +1110,9 @@ _gst_pc_thread (GstWebRTCBin * webrtc) g_main_context_invoke (webrtc->priv->main_context, (GSourceFunc) _unlock_pc_thread, PC_GET_LOCK (webrtc)); - /* Having the thread be the thread default GMainContext will break the - * required queue-like ordering (from W3's peerconnection spec) of re-entrant - * tasks */ + g_main_context_push_thread_default (webrtc->priv->main_context); g_main_loop_run (webrtc->priv->loop); + g_main_context_pop_thread_default (webrtc->priv->main_context); GST_OBJECT_LOCK (webrtc); g_main_context_unref (webrtc->priv->main_context);