pthreads: reset active_thread_type when slice thread_init returrns early
authorJanne Grunau <janne-libav@jannau.net>
Wed, 21 Dec 2011 12:07:54 +0000 (13:07 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jan 2012 21:24:57 +0000 (22:24 +0100)
(cherry picked from commit f77f640b3035d357a6c6ffcea243c7ea0d8ebc67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pthread.c

index 2154163..0399ea7 100644 (file)
@@ -239,8 +239,10 @@ static int thread_init(AVCodecContext *avctx)
     ThreadContext *c;
     int thread_count = avctx->thread_count;
 
-    if (thread_count <= 1)
+    if (thread_count <= 1) {
+        avctx->active_thread_type = 0;
         return 0;
+    }
 
     c = av_mallocz(sizeof(ThreadContext));
     if (!c)