mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 13:01:05 +00:00
gstreamer/clock: Unschedule clock ID when the receiver end of the channel is disconnected
This commit is contained in:
parent
4778d05238
commit
b59b5ada7e
1 changed files with 4 additions and 1 deletions
|
@ -117,7 +117,10 @@ impl ClockId {
|
||||||
let (sender, receiver) = mpsc::unbounded();
|
let (sender, receiver) = mpsc::unbounded();
|
||||||
|
|
||||||
self.wait_async(move |_clock, jitter, id| {
|
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))
|
Ok(Box::pin(receiver))
|
||||||
|
|
Loading…
Reference in a new issue