projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd4bd78
)
mpeg2enc: Get number of processors on win32
author
LRN
<lrn1986@gmail.com>
Thu, 19 Mar 2009 21:55:26 +0000
(14:55 -0700)
committer
David Schleef
<ds@schleef.org>
Wed, 22 Apr 2009 01:55:05 +0000
(18:55 -0700)
Fixes #573848.
Signed-off-by: David Schleef <ds@schleef.org>
ext/mpeg2enc/gstmpeg2encoptions.cc
patch
|
blob
|
history
diff --git
a/ext/mpeg2enc/gstmpeg2encoptions.cc
b/ext/mpeg2enc/gstmpeg2encoptions.cc
index 7891bc843873a8591344c2d262efad6884c57341..7db8b385be1171141e7b5085f820c9fa6339c0a3 100644
(file)
--- 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)