pthread: validate_thread_parameters() ignored slice-threading being intentionally off
authorAlexander Strange <astrange@ithinksw.com>
Sun, 3 Apr 2011 19:54:14 +0000 (15:54 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 9 Apr 2011 12:23:22 +0000 (08:23 -0400)
The thread_type API allows you to request only FF_THREAD_FRAME (instead of
FRAME | SLICE), but it was being ignored.
We don't implement both of them at the same time, so there isn't an effect
on current codecs, except that you can request no kinds of threading now
(a bit useless).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/pthread.c

index 70845f0..ba6e395 100644 (file)
@@ -877,7 +877,7 @@ static void validate_thread_parameters(AVCodecContext *avctx)
         avctx->active_thread_type = 0;
     } else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
         avctx->active_thread_type = FF_THREAD_FRAME;
-    } else {
+    } else if (avctx->thread_type & FF_THREAD_SLICE) {
         avctx->active_thread_type = FF_THREAD_SLICE;
     }
 }