]> git.sesse.net Git - vlc/commitdiff
AVcodec: disable slice_thread + HW decoding in MPEG-2
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 19 Jan 2012 22:03:56 +0000 (23:03 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 19 Jan 2012 22:09:20 +0000 (23:09 +0100)
Close #5867

modules/codec/avcodec/video.c

index b30e036242b5e59f05779703175c168618c342e4..94257d453bbe9369c7ca2bbb083cd688c24050d0 100644 (file)
@@ -363,7 +363,10 @@ 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 )
+        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 ) )
+          )
         {
             msg_Warn( p_dec, "threaded frame decoding is not compatible with ffmpeg-hw, disabled" );
             p_sys->p_context->thread_type &= ~FF_THREAD_FRAME;