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:
@@ -145,6 +145,11 @@ int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
|
||||
int i;
|
||||
ThreadContext *c;
|
||||
|
||||
avctx->thread_count = thread_count;
|
||||
|
||||
if (thread_count <= 1)
|
||||
return 0;
|
||||
|
||||
c = av_mallocz(sizeof(ThreadContext));
|
||||
if (!c)
|
||||
return -1;
|
||||
@@ -156,7 +161,6 @@ int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
|
||||
}
|
||||
|
||||
avctx->thread_opaque = c;
|
||||
avctx->thread_count = thread_count;
|
||||
c->current_job = 0;
|
||||
c->job_count = 0;
|
||||
c->job_size = 0;
|
||||
|
Reference in New Issue
Block a user