summaryrefslogtreecommitdiffstats
path: root/ext/mpeg2enc
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2009-03-19 14:55:26 -0700
committerDavid Schleef <ds@schleef.org>2009-04-21 18:55:05 -0700
commitbc29123723f7fcd2eaa2a61644de1d6bcf6eab33 (patch)
treec4f6d2d8acf29d6f31cfbbbf72b54963930bd53d /ext/mpeg2enc
parentdd4bd78f33da0099b2623b88c8e7e31bef340d0e (diff)
downloadgst-plugins-bad-bc29123723f7fcd2eaa2a61644de1d6bcf6eab33.tar.gz
gst-plugins-bad-bc29123723f7fcd2eaa2a61644de1d6bcf6eab33.tar.bz2
gst-plugins-bad-bc29123723f7fcd2eaa2a61644de1d6bcf6eab33.zip
mpeg2enc: Get number of processors on win32
Fixes #573848. Signed-off-by: David Schleef <ds@schleef.org>
Diffstat (limited to 'ext/mpeg2enc')
-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)