aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/w32thread.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/w32thread.c
parent5fcb865b7525f4ba6d601008bc6a2fb28be5af1e (diff)
downloadffmpeg-68cf92ee5e08331d6237a836adc74b4007fab4e9.tar.gz
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/w32thread.c')
-rw-r--r--libavcodec/w32thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/w32thread.c b/libavcodec/w32thread.c
index bae09704a8..4b8145729e 100644
--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -131,6 +131,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;