[vlc-commits] Avcodec: Fix slice-decoding of hwAccel + -mt

Jean-Baptiste Kempf git at videolan.org
Fri Jan 27 02:25:16 CET 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jan 27 02:18:46 2012 +0100| [8ab6e44a73a601db8a3912b5814a538fd90602e1] | committer: Jean-Baptiste Kempf

Avcodec: Fix slice-decoding of hwAccel + -mt

Close #5909 #5867
(cherry picked from commit f86e5ebbc95af8c0bcb8bcaa9ea6407fa69c0765)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/video.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 40f1618..8a85467 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -355,14 +355,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;
     }



More information about the vlc-commits mailing list