]> git.sesse.net Git - vlc/commitdiff
Avcodec: Fix slice-decoding of hwAccel + -mt
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Jan 2012 01:18:46 +0000 (02:18 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Jan 2012 01:20:18 +0000 (02:20 +0100)
Close #5909 #5867

modules/codec/avcodec/video.c

index 94257d453bbe9369c7ca2bbb083cd688c24050d0..b85ebc6a8e7a4d14dad627dc9cdc3ce9d83ac51d 100644 (file)
@@ -363,14 +363,17 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
          i_codec_id == CODEC_ID_VC1 || i_codec_id == CODEC_ID_WMV3) )
     {
 #ifdef HAVE_AVCODEC_MT
-        if( ( p_sys->p_context->thread_type & FF_THREAD_FRAME ) ||
-            ( ( p_sys->p_context->thread_type & FF_THREAD_SLICE ) &&
-              ( i_codec_id == CODEC_ID_MPEG1VIDEO || i_codec_id == CODEC_ID_MPEG2VIDEO ) )
-          )
+        if( p_sys->p_context->thread_type & FF_THREAD_FRAME )
         {
             msg_Warn( p_dec, "threaded frame decoding is not compatible with ffmpeg-hw, disabled" );
             p_sys->p_context->thread_type &= ~FF_THREAD_FRAME;
         }
+        if( ( p_sys->p_context->thread_type & FF_THREAD_SLICE ) &&
+            ( i_codec_id == CODEC_ID_MPEG1VIDEO || i_codec_id == CODEC_ID_MPEG2VIDEO ) )
+        {
+            msg_Warn( p_dec, "threaded slice decoding is not compatible with ffmpeg-hw, disabled" );
+            p_sys->p_context->thread_type &= ~FF_THREAD_SLICE;
+        }
 #endif
         p_sys->p_context->get_format = ffmpeg_GetFormat;
     }