From f77f640b3035d357a6c6ffcea243c7ea0d8ebc67 Mon Sep 17 00:00:00 2001
From: Janne Grunau <janne-libav@jannau.net>
Date: Wed, 21 Dec 2011 13:07:54 +0100
Subject: [PATCH] pthreads: reset active_thread_type when slice thread_init
 returrns early

---
 libavcodec/pthread.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 7e03c64f40b..ac15fefd683 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -237,8 +237,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)
-- 
GitLab