threadshare/udpsink: Unconfigure all clients that are removed on clear()

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/101
This commit is contained in:
Sebastian Dröge 2020-04-02 19:42:00 +03:00
parent 3f05e448d7
commit 9cdf09d106

View file

@ -358,12 +358,15 @@ impl UdpSinkPadHandlerInner {
gst_pad: &gst::Pad,
clients_to_add: impl Iterator<Item = SocketAddr>,
) {
Arc::make_mut(&mut self.clients).clear();
let old_clients = mem::replace(&mut *Arc::make_mut(&mut self.clients), vec![]);
self.clients_to_configure = vec![];
self.clients_to_unconfigure = vec![];
for addr in clients_to_add {
if !old_clients.contains(&addr) {
self.clients_to_unconfigure.push(addr);
}
self.add_client(gst_pad, addr);
}
}