diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index 6167840e..6c19fc27 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -149,7 +149,7 @@ impl Dav1dDec { element: &super::Dav1dDec, state_guard: &mut MutexGuard>, input_buffer: gst::Buffer, - frame: &gst_video::VideoCodecFrame, + frame: gst_video::VideoCodecFrame, ) -> Result, gst::FlowError> { gst_trace!( CAT, @@ -183,6 +183,7 @@ impl Dav1dDec { } Err(err) => { gst_error!(CAT, "Sending data failed (error code: {})", err); + element.release_frame(frame); return gst_video::video_decoder_error!( element, 1, @@ -554,7 +555,7 @@ impl VideoDecoderImpl for Dav1dDec { { let mut state_guard = self.state.lock().unwrap(); state_guard = self.forward_pending_pictures(element, state_guard)?; - if self.send_data(element, &mut state_guard, input_buffer, &frame)? + if self.send_data(element, &mut state_guard, input_buffer, frame)? == std::ops::ControlFlow::Continue(()) { loop {