mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-01 15:31:24 +00:00
threads: check defines before using them in automatic thread detection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8d4668cc5f
commit
5c33a9a5c1
@ -154,7 +154,7 @@ typedef struct FrameThreadContext {
|
||||
static int get_logical_cpus(AVCodecContext *avctx)
|
||||
{
|
||||
int ret, nb_cpus = 1;
|
||||
#if HAVE_SCHED_GETAFFINITY
|
||||
#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
|
||||
cpu_set_t cpuset;
|
||||
|
||||
CPU_ZERO(&cpuset);
|
||||
@ -167,7 +167,7 @@ static int get_logical_cpus(AVCodecContext *avctx)
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
nb_cpus = sysinfo.dwNumberOfProcessors;
|
||||
#elif HAVE_SYSCTL
|
||||
#elif HAVE_SYSCTL && defined(HW_NCPU)
|
||||
int mib[2] = { CTL_HW, HW_NCPU };
|
||||
size_t len = sizeof(nb_cpus);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user