From c5a625ae28e50d8b8695c97afb3077042bbe8619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 22 Jan 2023 00:27:22 +0200 Subject: [PATCH] dav1d: Don't flush the decoder when draining This directly discards all frames and it won't be possible to output them anymore. Part-of: --- video/dav1d/src/dav1ddec/imp.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index 66e43095..c9bad0a9 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -749,10 +749,8 @@ impl VideoDecoderImpl for Dav1dDec { gst::info!(CAT, imp: self, "Draining"); { - let mut state_guard = self.state.lock().unwrap(); + let state_guard = self.state.lock().unwrap(); if state_guard.is_some() { - let state = state_guard.as_mut().unwrap(); - self.flush_decoder(state); let _state_guard = self.forward_pending_pictures(state_guard, true)?; } } @@ -764,10 +762,8 @@ impl VideoDecoderImpl for Dav1dDec { gst::info!(CAT, imp: self, "Finishing"); { - let mut state_guard = self.state.lock().unwrap(); + let state_guard = self.state.lock().unwrap(); if state_guard.is_some() { - let state = state_guard.as_mut().unwrap(); - self.flush_decoder(state); let _state_guard = self.forward_pending_pictures(state_guard, true)?; } }