From bc29123723f7fcd2eaa2a61644de1d6bcf6eab33 Mon Sep 17 00:00:00 2001 From: LRN Date: Thu, 19 Mar 2009 14:55:26 -0700 Subject: [PATCH] mpeg2enc: Get number of processors on win32 Fixes #573848. Signed-off-by: David Schleef --- ext/mpeg2enc/gstmpeg2encoptions.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/mpeg2enc/gstmpeg2encoptions.cc b/ext/mpeg2enc/gstmpeg2encoptions.cc index 7891bc8438..7db8b385be 100644 --- a/ext/mpeg2enc/gstmpeg2encoptions.cc +++ b/ext/mpeg2enc/gstmpeg2encoptions.cc @@ -24,6 +24,9 @@ #endif #include "gstmpeg2encoptions.hh" +#if WIN32 +# include //For GetSystemInfo +#endif #include @@ -285,7 +288,13 @@ GstMpeg2EncOptions::GstMpeg2EncOptions (): MPEG2EncOptions () { /* autodetect number of CPUs */ +#ifndef WIN32 num_cpus = sysconf (_SC_NPROCESSORS_ONLN); +#else + SYSTEM_INFO si; + GetSystemInfo(&si); + num_cpus = si.dwNumberOfProcessors; +#endif if (num_cpus < 0) num_cpus = 1; if (num_cpus > 32)