if( decoder->capabilities & AV_CODEC_CAP_DR1 )
avctx->flags |= CODEC_FLAG_EMU_EDGE;
avcodec_parameters_to_context(avctx, st->codecpar);
+ if( !av_dict_get(copts, "threads", NULL, 0) )
+ avctx->thread_count = ffmpeg->ff_cpus();
ret = avcodec_open2(avctx, decoder, &copts);
}
if( ret >= 0 ) {
av_dict_set(&sopts, "cin_bitrate", 0, 0);
av_dict_set(&sopts, "cin_quality", 0, 0);
+ if( !av_dict_get(sopts, "threads", NULL, 0) )
+ ctx->thread_count = ff_cpus();
ret = avcodec_open2(ctx, codec, &sopts);
if( ret >= 0 ) {
ret = avcodec_parameters_from_context(st->codecpar, ctx);
}
if( ret >= 0 ) {
avcodec_parameters_to_context(avctx, st->codecpar);
+ if( !av_dict_get(copts, "threads", NULL, 0) )
+ avctx->thread_count = ff_cpus();
ret = avcodec_open2(avctx, decoder, &copts);
}
av_dict_free(&copts);