Release 'state' lock before emitting signals

This commit is contained in:
Thibault Saunier 2022-02-08 12:16:11 +00:00 committed by Mathieu Duponchelle
parent 794df19122
commit 22205c235d

View file

@ -1724,7 +1724,6 @@ impl WebRTCSink {
}
})?;
element.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
if settings.enable_data_channel_navigation {
state.navigation_handler = Some(
NavigationEventHandler::new(&element, &webrtcbin)
@ -1740,6 +1739,9 @@ impl WebRTCSink {
state.consumers.insert(peer_id.to_string(), consumer);
drop(state);
element.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
Ok(())
}