Bug 1344909 When compiled with MinGW, use only a single core in gmp-clearkey draft
authorTom Ritter <tom@mozilla.com>
Thu, 23 Mar 2017 13:58:54 -0500
changeset 503905 f5c7d2da47a9c58f75b1e41528dee20697c1f020
parent 503904 9a11e39ad50b3a3a5b0188e2ce1f77e2752d2fad
child 503917 b145fa2f01c9bcdf8ccf58cacf52ea4d651d764a
push id50697
push userbmo:tom@mozilla.com
push dateThu, 23 Mar 2017 18:59:31 +0000
bugs1344909
milestone55.0a1
Bug 1344909 When compiled with MinGW, use only a single core in gmp-clearkey MozReview-Commit-ID: Ej9avF7TkaL
media/gmp-clearkey/0.1/VideoDecoder.cpp
--- a/media/gmp-clearkey/0.1/VideoDecoder.cpp
+++ b/media/gmp-clearkey/0.1/VideoDecoder.cpp
@@ -32,17 +32,23 @@ VideoDecoder::VideoDecoder(Host_8 *aHost
 {
   CK_LOGD("VideoDecoder created");
 
   // We drop the ref in DecodingComplete().
   AddRef();
 
   mDecoder = new WMFH264Decoder();
 
+  // MinGW Does not support std::thread (See #1349912)
+#ifdef __MINGW32__
+  uint32_t cores = 1u;
+#else
   uint32_t cores = std::max(1u, std::thread::hardware_concurrency());
+#endif
+
   HRESULT hr = mDecoder->Init(cores);
 }
 
 VideoDecoder::~VideoDecoder()
 {
   CK_LOGD("VideoDecoder destroyed");
 }