From 4720b575b69dff7be48815adaef33088fbc2c184 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 29 Nov 2024 18:52:41 +0100 Subject: [PATCH] webrtscink: fix deadlock when answering Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/637 Part-of: --- net/webrtc/src/webrtcsink/imp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 576876f8..3abdb6d0 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -2416,7 +2416,9 @@ impl BaseWebRTCSink { let signaller = settings.signaller.clone(); drop(settings); - if let Some(session) = self.state.lock().unwrap().sessions.get(session_id).cloned() { + let session = self.state.lock().unwrap().sessions.get(session_id).cloned(); + + if let Some(session) = session { let mut session = session.0.lock().unwrap(); let sdp = answer.sdp();