提交 32d021cf 编写于 作者: J James Zern

avcodec/libvpxdec: fix setting auto threads

a thread count of 0 is treated the same as 1, use av_cpu_count() to get
the correct thread count when auto threads is requested.

this matches the fix in libvpxenc:
27df34bf avcodec/libvpxenc: fix setting amount of threads used for encoding
Reviewed-by: NJames Almer <jamrial@gmail.com>
Signed-off-by: NJames Zern <jzern@google.com>
上级 f3bcb9c1
......@@ -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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册