shithub: openh264

Download patch

ref: 7150adc91b4abc0be8453aacdcc68ea37a2314e5
parent: 8f981a4282f0bc3356e2ac4d3d9aaa83a01b093b
parent: cf07d61f0622a886d657abf3e694d6cc1043bf89
author: volvet <[email protected]>
date: Wed Mar 5 04:18:45 EST 2014

Merge pull request #407 from mstorsjo/do-blocking-wait

Do a blocking wait with WelsMultipleEventsWaitSingleBlocking

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3280,7 +3280,7 @@
 
             lwait = WelsMultipleEventsWaitSingleBlocking (iNumThreadsScheduled,
                     &pCtx->pSliceThreading->pSliceCodedEvent[0],
-                    2);	// 2 ms for one tick
+                    (uint32_t) -1);
             iEventId = (int32_t) (lwait - WELS_THREAD_ERROR_WAIT_OBJECT_0);
             if (iEventId >= 0 && iEventId < iNumThreadsScheduled) {
               if (iIndexOfSliceToBeCoded < iSliceCount) {
@@ -3293,8 +3293,6 @@
               } else {	// no other slices left for coding
                 -- iNumThreadsRunning;
               }
-            } else {
-              WelsSleep (1);
             }
 #else
             // TODO for pthread platforms