[vlc-devel] [PATCH] avcodec: tell the vout not to peek in the decoder pool anymore when closing

Steve Lhomme robux4 at videolabs.io
Wed Dec 20 14:07:48 CET 2017


There's still the vout->p->displayed.current picture that may be owned by the
hardware acceleration that is still not released.
---
 modules/codec/avcodec/video.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index b056c1b86f..44e7e6d00f 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1245,6 +1245,11 @@ void EndVideoDec( vlc_object_t *obj )
     AVCodecContext *ctx = p_sys->p_context;
     void *hwaccel_context;
 
+    /* Abort pictures in order to unblock all avcodec workers threads waiting
+     * for a picture. This will avoid a deadlock between avcodec_flush_buffers
+     * and workers threads */
+    decoder_AbortPictures( p_dec, true );
+
     post_mt( p_sys );
 
     /* do not flush buffers if codec hasn't been opened (theora/vorbis/VC1) */
-- 
2.14.2



More information about the vlc-devel mailing list