[vlc-commits] avcodec: missing lock in get_format()

Rémi Denis-Courmont git at videolan.org
Mon Apr 27 18:24:39 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 27 19:24:05 2015 +0300| [e6d165e33020a6391da9a2479439785c1fd6faf2] | committer: Rémi Denis-Courmont

avcodec: missing lock in get_format()

Pointed-out-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e6d165e33020a6391da9a2479439785c1fd6faf2
---

 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 75f1132..89bdbcb 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1122,6 +1122,8 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
     if (!can_hwaccel)
         return swfmt;
 
+    wait_mt(p_sys);
+
     for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
     {
         enum PixelFormat hwfmt = pi_fmt[i];
@@ -1147,6 +1149,8 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
             continue;
         }
 
+        post_mt(p_sys);
+
         if (va->description != NULL)
             msg_Info(p_dec, "Using %s for hardware decoding", va->description);
 
@@ -1159,6 +1163,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
         return pi_fmt[i];
     }
 
+    post_mt(p_sys);
     /* Fallback to default behaviour */
     return swfmt;
 }



More information about the vlc-commits mailing list