diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 7e03c64f40b1fca56eb540ee39bd95a528f11632..ac15fefd683aad72a30087df13f8e3d524545e23 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)