[vlc-commits] avcodec: add missing post/wait when opening the codec

Rémi Denis-Courmont git at videolan.org
Sun May 3 16:04:34 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  3 16:59:28 2015 +0300| [4b3cb0440814be5a22a7c10c15c2a336af9d8545] | committer: Rémi Denis-Courmont

avcodec: add missing post/wait when opening the codec

AVCodecContext callbacks can also be invoked then.

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

 modules/codec/avcodec/video.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index f872c6d..9be7aa5 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -243,6 +243,7 @@ static void lavc_CopyPicture(decoder_t *dec, picture_t *pic, AVFrame *frame)
 static int OpenVideoCodec( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
+    int ret;
 
     if( p_sys->p_context->extradata_size <= 0 )
     {
@@ -267,7 +268,9 @@ static int OpenVideoCodec( decoder_t *p_dec )
         p_sys->p_context->coded_height = p_dec->fmt_in.video.i_height;
     p_sys->p_context->bits_per_coded_sample = p_dec->fmt_in.video.i_bits_per_pixel;
 
-    int ret = ffmpeg_OpenCodec( p_dec );
+    post_mt( p_sys );
+    ret = ffmpeg_OpenCodec( p_dec );
+    wait_mt( p_sys );
     if( ret < 0 )
         return ret;
 
@@ -292,7 +295,7 @@ static int OpenVideoCodec( decoder_t *p_dec )
             break;
     }
 #endif
-    return VLC_SUCCESS;
+    return 0;
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list