gstreamer/clock: Unschedule clock ID when the receiver end of the channel is disconnected

This commit is contained in:
Sebastian Dröge 2020-10-01 11:25:40 +03:00
parent 4778d05238
commit b59b5ada7e

View file

@ -117,7 +117,10 @@ impl ClockId {
let (sender, receiver) = mpsc::unbounded();
self.wait_async(move |_clock, jitter, id| {
let _ = sender.unbounded_send((jitter, id.clone()));
if sender.unbounded_send((jitter, id.clone())).is_err() {
// Unschedule any future calls if the receiver end is disconnected
id.unschedule();
}
})?;
Ok(Box::pin(receiver))