net/webrtcsink: drop State lock before calling set-local-description

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1325>
This commit is contained in:
François Laignel 2023-09-18 17:01:07 +02:00 committed by GStreamer Marge Bot
parent c021e2b69f
commit 785c9557c8

View file

@ -1839,12 +1839,13 @@ impl BaseWebRTCSink {
.and_then(|format| format.parse::<i32>().ok());
}
// FIXME I think the intention was to drop(state) and re-acquire the lock after the call
drop(state);
session
.webrtcbin
.emit_by_name::<()>("set-local-description", &[&answer, &None::<gst::Promise>]);
let mut state = self.state.lock().unwrap();
let session_id = session.id.clone();
if let Some(session_wrapper) = state.sessions.get_mut(&session_id) {