avcodec/libvpxenc: fix setting amount of threads used for encoding
authorJames Almer <jamrial@gmail.com>
Sat, 19 May 2018 18:01:56 +0000 (15:01 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 21 May 2018 21:52:31 +0000 (18:52 -0300)
commit27df34bf1f7a113086ba5c68d2a58b7c430c301f
treec9b7fad78c20eeb51cf859e4f7ce360f860ea89e
parentba7d1377e85662f7b4ae728719c10d5427cc6b9b
avcodec/libvpxenc: fix setting amount of threads used for encoding

The libvpx doxy says that a value of 0 for the g_threads field is
equivalent to a value of 1, whereas for avctx->thread_count it means
the maximum amount of threads possible for the host system.

Use av_cpu_count() to get the correct thread count when auto threads
is requested.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/libvpxenc.c