Use threading macros in mpeg12.c.

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

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 282d147..d5132ce 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -34,6 +34,7 @@
 #include "mpeg12data.h"
 #include "mpeg12decdata.h"
 #include "bytestream.h"
+#include "thread.h"
 
 //#undef NDEBUG
 //#include <assert.h>
@@ -2305,7 +2306,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 != FF_B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
-                if(avctx->thread_count > 1){
+                if(USE_AVCODEC_EXECUTE(avctx)){
                     int i;
 
                     avctx->execute(avctx, slice_decode_thread,  (void**)&(s2->thread_context[0]), NULL, s->slice_count);
@@ -2390,7 +2391,7 @@ static int decode_chunks(AVCodecContext *avctx,
                     return -1;
                 }
 
-                if(avctx->thread_count > 1){
+                if(USE_AVCODEC_EXECUTE(avctx)){
                     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];
@@ -2478,7 +2479,7 @@ AVCodec mpegvideo_decoder = {
 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
     Mpeg1Context *s;
 
-    if( avctx->thread_count > 1)
+    if( USE_AVCODEC_EXECUTE(avctx) )
         return -1;
     if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
         return -1;
-- 
1.5.5.1


_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to