summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-01-01 14:21:50 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-01-01 14:37:37 +0100
commitb4d44a45f9aa43bd2e5bddde33e3b37802607b0a (patch)
tree607eb03dedfb5ce9249e3094cd3a9d3f46524852 /libavcodec/pthread.c
parentfebd022228660cb4b4d0e7b108bfec339b7dce92 (diff)
downloadffmpeg-b4d44a45f9aa43bd2e5bddde33e3b37802607b0a.tar.gz
threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264
Some external codecs have their own code to determine the best number of threads. This number is not necessary the number of cpu cores. Thread_count will be only 0 if the codec has CODEC_CAP_AUTO_THREADS.
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 400abf4f6c..54a0eb3ab7 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -982,6 +982,9 @@ static void validate_thread_parameters(AVCodecContext *avctx)
} else if (avctx->codec->capabilities & CODEC_CAP_SLICE_THREADS &&
avctx->thread_type & FF_THREAD_SLICE) {
avctx->active_thread_type = FF_THREAD_SLICE;
+ } else if (!(avctx->codec->capabilities & CODEC_CAP_AUTO_THREADS)) {
+ avctx->thread_count = 1;
+ avctx->active_thread_type = 0;
}
}