summaryrefslogtreecommitdiff
path: root/libavcodec/libvpxenc.c
diff options
context:
space:
mode:
authorChirag Lathia <clathia@google.com>2018-11-15 10:51:32 -0800
committerJames Almer <jamrial@gmail.com>2018-11-15 21:25:53 -0300
commitd6b1248fc6aa17dd03cb41403c70c85183078fd2 (patch)
treec15c3ea3339e014c49ea72180fce9f23d4baa03b /libavcodec/libvpxenc.c
parentaecd63b926812148014c4f01270473722ae5e945 (diff)
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>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r--libavcodec/libvpxenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index ad440a9c21..da9b9c6d46 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -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)