shithub: openh264

Download patch

ref: 99cd09ab2b57e534d7a994f04fdfd7154fd6b9b7
parent: 35d921ba9803422ec0c7b5bd53a5d0530388783e
parent: f96e7e4b06b8fe0ae4fa03a578eec4f84d740717
author: ruil2 <ruil2@cisco.com>
date: Sun Apr 30 05:30:10 EDT 2017

Merge pull request #2737 from mstorsjo/fix-win32-threads

Fix threading on windows after c51a4ff09

--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -141,8 +141,11 @@
 }
 
 WELS_THREAD_ERROR_CODE    WelsEventSignal (WELS_EVENT* event, WELS_MUTEX *pMutex, int* iCondition) {
-  if (SetEvent (*event)) {
-    return WELS_THREAD_ERROR_OK;
+  (*iCondition) --;
+  if ((*iCondition) <= 0) {
+    if (SetEvent (*event)) {
+      return WELS_THREAD_ERROR_OK;
+    }
   }
   return WELS_THREAD_ERROR_GENERAL;
 }