X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibvpxdec.c;h=164dbda49b08d18d736b810ec6cf18e1e3e56ad1;hb=b2f32d60eeaf883bb7d9e1b8cc2fb9a983d08f72;hp=04f27d339610742e23dfdfbf85037ffcf7136071;hpb=ce265b0bf5d0c77a092a1f5fbeb652c7cdea5fc7;p=ffmpeg diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 04f27d33961..164dbda49b0 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -47,8 +47,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, { VPxContext *ctx = avctx->priv_data; struct vpx_codec_dec_cfg deccfg = { - /* token partitions+1 would be a decent choice */ - .threads = FFMIN(avctx->thread_count, 16) + .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) }; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());