[FFmpeg-cvslog] threads: check defines before using them in automatic thread detection

Janne Grunau git at videolan.org
Fri Dec 23 16:10:21 CET 2011


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Fri Dec 23 11:10:37 2011 +0100| [5c33a9a5c138324e9405bf680b950cfb7f02f3ee] | committer: Michael Niedermayer

threads: check defines before using them in automatic thread detection

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c33a9a5c138324e9405bf680b950cfb7f02f3ee
---

 libavcodec/pthread.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index eb3e7d4..653fb0f 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -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);
 



More information about the ffmpeg-cvslog mailing list