for(i=0;i<ic->nb_streams;i++) {
AVStream *st = ic->streams[i];
AVCodecContext *enc = st->codec;
- if(thread_count>1)
avcodec_thread_init(enc, thread_count);
switch(enc->codec_type) {
case CODEC_TYPE_AUDIO:
bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
video_bitstream_filters= NULL;
- if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
video_enc = st->codec;
bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
audio_bitstream_filters= NULL;
- if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
audio_enc = st->codec;
enc->skip_loop_filter= skip_loop_filter;
enc->error_recognition= error_recognition;
enc->error_concealment= error_concealment;
- if (thread_count > 1)
avcodec_thread_init(enc, thread_count);
set_context_opts(enc, avcodec_opts[enc->codec_type], 0);
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;
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;
int i;
ThreadContext *c;
+ avctx->thread_count = thread_count;
+
+ if (thread_count <= 1)
+ return 0;
+
c = av_mallocz(sizeof(ThreadContext));
if (!c)
return -1;
}
avctx->thread_opaque = c;
- avctx->thread_count = thread_count;
c->current_job = 0;
c->job_count = 0;
c->job_size = 0;
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;