Check for thread_count==0.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 10 Sep 2009 14:12:05 +0000 (14:12 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 10 Sep 2009 14:12:05 +0000 (14:12 +0000)
fixed issue1333

Originally committed as revision 19809 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo_enc.c

index 9036588..6e7837a 100644 (file)
@@ -441,6 +441,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    if(s->avctx->thread_count < 1){
+        av_log(avctx, AV_LOG_ERROR, "automatic thread number detection not supported by codec, patch welcome\n");
+        return -1;
+    }
+
     if(s->avctx->thread_count > 1)
         s->rtp_mode= 1;