[FFmpeg-cvslog] mpeg12: add slice-threading checks to slice-threading initializers.

Ronald S. Bultje git at videolan.org
Thu May 19 06:02:19 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Tue May 17 10:26:29 2011 -0400| [508a24f8dc63e74bd9917e6f0c4cdbb744741ef0] | committer: Ronald S. Bultje

mpeg12: add slice-threading checks to slice-threading initializers.

Fixes "make THREADS=2 THREAD_TYPE=1 fate-mpeg2-field-enc".

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=508a24f8dc63e74bd9917e6f0c4cdbb744741ef0
---

 libavcodec/mpeg12.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index ffe6b94..88ed533 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2262,7 +2262,7 @@ static int decode_chunks(AVCodecContext *avctx,
         buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
         if (start_code > 0x1ff){
             if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT){
-                if(avctx->thread_count > 1){
+                if((avctx->active_thread_type & FF_THREAD_SLICE) && avctx->thread_count > 1){
                     int i;
 
                     avctx->execute(avctx, slice_decode_thread,  &s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
@@ -2430,7 +2430,7 @@ static int decode_chunks(AVCodecContext *avctx,
                     break;
                 }
 
-                if(avctx->thread_count > 1){
+                if((avctx->active_thread_type & FF_THREAD_SLICE) && avctx->thread_count > 1){
                     int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
                     if(threshold <= mb_y){
                         MpegEncContext *thread_context= s2->thread_context[s->slice_count];
@@ -2541,7 +2541,7 @@ AVCodec ff_mpegvideo_decoder = {
 
 #if CONFIG_MPEG_XVMC_DECODER
 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
-    if( avctx->thread_count > 1)
+    if((avctx->active_thread_type & FF_THREAD_SLICE) && avctx->thread_count > 1)
         return -1;
     if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
         return -1;



More information about the ffmpeg-cvslog mailing list