mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 12:55:13 +00:00
threadshare/udpsink: Don't hold settings lock while calling into the sink pad handler to clear the clients
Otherwise we can deadlock because of a lock order issue: - render() is called with the sink pad handler lock and takes the settings lock - clearing clients takes the sink pad handler lock
This commit is contained in:
parent
98b618cc9d
commit
89346fa945
1 changed files with 6 additions and 3 deletions
|
@ -1403,10 +1403,12 @@ impl ObjectImpl for UdpSink {
|
|||
.expect("type checked upstream")
|
||||
.unwrap_or_else(|| "".into());
|
||||
|
||||
let current_client = settings
|
||||
.host
|
||||
let host = settings.host.clone();
|
||||
let port = settings.port;
|
||||
|
||||
let current_client = host
|
||||
.iter()
|
||||
.filter_map(|host| try_into_socket_addr(&element, host, settings.port).ok());
|
||||
.filter_map(|host| try_into_socket_addr(&element, &host, port).ok());
|
||||
|
||||
let clients_iter = current_client.chain(clients.split(',').filter_map(|client| {
|
||||
let rsplit: Vec<&str> = client.rsplitn(2, ':').collect();
|
||||
|
@ -1429,6 +1431,7 @@ impl ObjectImpl for UdpSink {
|
|||
None
|
||||
}
|
||||
}));
|
||||
drop(settings);
|
||||
|
||||
self.clear_clients(clients_iter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue