diff --git a/gst-plugin-threadshare/src/jitterbuffer.rs b/gst-plugin-threadshare/src/jitterbuffer.rs index 598d02ce..a9536685 100644 --- a/gst-plugin-threadshare/src/jitterbuffer.rs +++ b/gst-plugin-threadshare/src/jitterbuffer.rs @@ -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(); } _ => (), diff --git a/gst-plugin-threadshare/src/lib.rs b/gst-plugin-threadshare/src/lib.rs index 62bb58fd..8f71a09a 100644 --- a/gst-plugin-threadshare/src/lib.rs +++ b/gst-plugin-threadshare/src/lib.rs @@ -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 _) } }