[vlc-devel] [RFC PATCH 3/3] decoder: cancel the vout on close

Thomas Guillem thomas at gllm.fr
Wed Nov 18 14:32:01 CET 2015


This fixes a deadlock if a decoder module is waiting on decoder_GetPicture /
decoder_NewPicture when it's closing.
---
 src/input/decoder.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 1f89dc9..c9f401b 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1588,6 +1588,12 @@ static void DeleteDecoder( decoder_t * p_dec )
              (unsigned)block_FifoCount( p_owner->p_fifo ) );
 
     const bool b_flush_spu = p_dec->fmt_out.i_cat == SPU_ES;
+
+    /* Cancel the vout: unblock the DecoderThread if it's stuck in
+     * decoder_GetPicture / decoder_NewPicture */
+    if( p_owner->p_vout )
+        vout_Cancel( p_owner->p_vout );
+
     UnloadDecoder( p_dec );
 
     /* Free all packets still in the decoder fifo. */
-- 
2.1.4



More information about the vlc-devel mailing list