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 b4e8ace192
commit 2b87e5f51d

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))