[vlc-devel] [PATCH 2/2] avcodec: protect the flush call

Thomas Guillem thomas at gllm.fr
Fri Sep 20 09:31:25 CEST 2019


---
 modules/codec/avcodec/video.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index fea2a7979b..c9bd857c1f 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1334,7 +1334,11 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
     /* After draining, we need to reset decoder with a flush */
     if( b_drained )
+    {
+        post_mt( p_sys );
         avcodec_flush_buffers( p_sys->p_context );
+        wait_mt( p_sys );
+    }
 
     if( p_block )
         block_Release( p_block );
-- 
2.20.1



More information about the vlc-devel mailing list