mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-27 05:51:01 +00:00
jitterbuffer: fix tear down
- Release pending future id in READY -> NULL - Verify that we still have an io_context in the timeout's closure
This commit is contained in:
parent
60a19826e6
commit
8a4d517dec
1 changed files with 11 additions and 0 deletions
|
@ -827,6 +827,11 @@ impl JitterBuffer {
|
|||
.and_then(move |_| {
|
||||
let jb = Self::from_instance(&element_clone);
|
||||
let mut state = jb.state.lock().unwrap();
|
||||
|
||||
if state.io_context.is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let now = jb.get_current_running_time(&element_clone);
|
||||
|
||||
gst_debug!(
|
||||
|
@ -1301,6 +1306,12 @@ impl ElementImpl for JitterBuffer {
|
|||
gst::StateChange::ReadyToNull => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
state
|
||||
.io_context
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.release_pending_future_id(state.pending_future_id.unwrap());
|
||||
state.pending_future_id = None;
|
||||
let _ = state.io_context.take();
|
||||
}
|
||||
_ => (),
|
||||
|
|
Loading…
Reference in a new issue