[FFmpeg-devel] [PATCH]Two patches from github

wm4 nfxjfg at googlemail.com
Mon May 15 13:53:23 EEST 2017


On Mon, 15 May 2017 12:40:23 +0200
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> From 42766f345dbf398716c6fd9072f072f5fa91c940 Mon Sep 17 00:00:00 2001
> From: Steve Kondik <steve at cyngn.com>
> Date: Tue, 16 Dec 2014 01:37:57 -0800
> Subject: [PATCH 2/2] avutil: Use _SC_NPROCESSORS_CONF
> 
>  * On most Android devices, CPUs can appear and disappear due to hotplug
>    or CPU cluster management. Use the total number of CPUs instead so
>    that multithreaded decoding is properly optimized.

This explanation isn't really sufficient. Also not why you would want
this, or why you would want this only on Android.

> Change-Id: I1cbf000a1bda7b3abf0a84e971e752f176857385

what is this?

> ---
>  libavutil/cpu.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> index 16e0c92..ab0965b 100644
> --- a/libavutil/cpu.c
> +++ b/libavutil/cpu.c
> @@ -282,6 +282,8 @@ int av_cpu_count(void)
>  
>      if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
>          nb_cpus = 0;
> +#elif defined(__ANDROID__) && HAVE_SYSCONF && defined(_SC_NPROCESSORS_CONF)
> +    nb_cpus = sysconf(_SC_NPROCESSORS_CONF);
>  #elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN)
>      nb_cpus = sysconf(_SC_NPROC_ONLN);
>  #elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN)



More information about the ffmpeg-devel mailing list