提交 5c33a9a5 编写于 作者: J Janne Grunau 提交者: Michael Niedermayer

threads: check defines before using them in automatic thread detection

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 8d4668cc
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册