shithub: openh264

Download patch

ref: d04c7b93473afad575104ab8130a3fd16c236858
parent: 507ffbadb6d63bed5376be0314d8c07470632844
parent: 522639f7682c3a0e5d7cffbb792390281fcd1479
author: Ethan Hugg <ethanhugg@gmail.com>
date: Sat Jul 4 07:30:28 EDT 2015

Merge pull request #2020 from brion/emscripten

Allow compilation to JavaScript via emscripten

--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -30,6 +30,7 @@
 Sawyer Shan
 Siping Tao
 Martin Storsjö
+Brion Vibber
 James Wang
 Juanny Wang
 Zhiliang Wang
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -483,6 +483,12 @@
 
   return WELS_THREAD_ERROR_OK;
 
+#elif defined(__EMSCRIPTEN__)
+
+  // There is not yet a way to determine CPU count in emscripten JS environment.
+  pInfo->ProcessorCount = 1;
+  return WELS_THREAD_ERROR_OK;
+
 #else
 
   size_t len = sizeof (pInfo->ProcessorCount);