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
This commit is contained in:
Måns Rullgård
2010-01-20 22:55:50 +00:00
parent 5fcb865b75
commit 68cf92ee5e
6 changed files with 14 additions and 5 deletions

View File

@@ -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;