summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2009-03-19 14:55:26 -0700
committerDave Robillard <dave@drobilla.net>2009-05-03 12:03:16 -0400
commit4617c8449a59395a96fc0c8bacf2bd3b9787b245 (patch)
treeac21efbb2cfdb520d47695b1223135ea26e8bfd6 /ext
parentd146014528d2df8f7d1618077878c142559a3945 (diff)
downloadgst-plugins-bad-4617c8449a59395a96fc0c8bacf2bd3b9787b245.tar.gz
gst-plugins-bad-4617c8449a59395a96fc0c8bacf2bd3b9787b245.tar.bz2
gst-plugins-bad-4617c8449a59395a96fc0c8bacf2bd3b9787b245.zip
mpeg2enc: Get number of processors on win32
Fixes #573848. Signed-off-by: David Schleef <ds@schleef.org>
Diffstat (limited to 'ext')
-rw-r--r--ext/mpeg2enc/gstmpeg2encoptions.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/mpeg2enc/gstmpeg2encoptions.cc b/ext/mpeg2enc/gstmpeg2encoptions.cc
index 7891bc84..7db8b385 100644
--- a/ext/mpeg2enc/gstmpeg2encoptions.cc
+++ b/ext/mpeg2enc/gstmpeg2encoptions.cc
@@ -24,6 +24,9 @@
#endif
#include "gstmpeg2encoptions.hh"
+#if WIN32
+# include <windows.h> //For GetSystemInfo
+#endif
#include <gst/gst.h>
@@ -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)