ffmpeg | branch: release/4.4 | Brad Smith <b...@comstyle.com> | Sat Apr 3 14:49:20 2021 -0400| [7e9b9f24df6c98df5bf4c8ce41154b67f485e45f] | committer: Marton Balint
avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD Signed-off-by: Brad Smith <b...@comstyle.com> Signed-off-by: Marton Balint <c...@passwd.hu> (cherry picked from commit c8fb68ec52194d3de2f24a6850cd795d98eb2f2f) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e9b9f24df6c98df5bf4c8ce41154b67f485e45f --- libavutil/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 52f6b9a3bf..6bd0f07a62 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -291,6 +291,12 @@ int av_cpu_count(void) DWORD_PTR proc_aff, sys_aff; if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff)) nb_cpus = av_popcount64(proc_aff); +#elif HAVE_SYSCTL && defined(HW_NCPUONLINE) + int mib[2] = { CTL_HW, HW_NCPUONLINE }; + size_t len = sizeof(nb_cpus); + + if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1) + nb_cpus = 0; #elif HAVE_SYSCTL && defined(HW_NCPU) int mib[2] = { CTL_HW, HW_NCPU }; size_t len = sizeof(nb_cpus); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".