avcodec/libvpxenc: Add a maximum constraint of 16 encoder threads.

Signed-off-by: Chirag Lathia <clathia@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Chirag Lathia 2018-11-15 10:51:32 -08:00 committed by James Almer
parent aecd63b926
commit d6b1248fc6
1 changed files with 2 additions and 1 deletions

View File

@ -497,7 +497,8 @@ static av_cold int vpx_init(AVCodecContext *avctx,
enccfg.g_h = avctx->height;
enccfg.g_timebase.num = avctx->time_base.num;
enccfg.g_timebase.den = avctx->time_base.den;
enccfg.g_threads = avctx->thread_count ? avctx->thread_count : av_cpu_count();
enccfg.g_threads =
FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16);
enccfg.g_lag_in_frames= ctx->lag_in_frames;
if (avctx->flags & AV_CODEC_FLAG_PASS1)