summaryrefslogtreecommitdiff
path: root/libavcodec/os2thread.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-01-20 22:55:50 +0000
committerMåns Rullgård <mans@mansr.com>2010-01-20 22:55:50 +0000
commit68cf92ee5e08331d6237a836adc74b4007fab4e9 (patch)
tree940d14641a23b82d9953953457338b1e9d2e11eb /libavcodec/os2thread.c
parent5fcb865b7525f4ba6d601008bc6a2fb28be5af1e (diff)
Always call avcodec_thread_init()
The various avcodec_thread_init() functions are updated to return immediately after setting avctx->thread_count. This allows -threads 0 to pass through to codecs. It also simplifies the usage for apps using libavcodec. Originally committed as revision 21358 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/os2thread.c')
-rw-r--r--libavcodec/os2thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/os2thread.c b/libavcodec/os2thread.c
index edebc9a6c8..76dc0d56bc 100644
--- a/libavcodec/os2thread.c
+++ b/libavcodec/os2thread.c
@@ -116,6 +116,9 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){
s->thread_count= thread_count;
+ if (thread_count <= 1)
+ return 0;
+
assert(!s->thread_opaque);
c= av_mallocz(sizeof(ThreadContext)*thread_count);
s->thread_opaque= c;