jitterbuffer: flush RTPJitterBuffer when going to NULL

and cancel our timer
This commit is contained in:
Mathieu Duponchelle 2019-10-03 14:48:46 +02:00 committed by Sebastian Dröge
parent 8a4d517dec
commit 9897336896
2 changed files with 4 additions and 1 deletions

View file

@ -1312,6 +1312,10 @@ impl ElementImpl for JitterBuffer {
.unwrap()
.release_pending_future_id(state.pending_future_id.unwrap());
state.pending_future_id = None;
state.jbuf.borrow().flush();
let _ = state.cancel.take();
let _ = state.io_context.take();
}
_ => (),

View file

@ -322,7 +322,6 @@ impl Drop for RTPJitterBufferItem {
fn drop(&mut self) {
unsafe {
if let Some(ref item) = self.0 {
eprintln!("Unreffing buffer!");
gst_ffi::gst_mini_object_unref(item.data as *mut _)
}
}