OSDN Git Service

BufferQueue: fixed issues with buffer slots not available
authorDaniel Lam <dalam@google.com>
Wed, 7 Mar 2012 22:11:29 +0000 (14:11 -0800)
committerDaniel Lam <dalam@google.com>
Fri, 9 Mar 2012 07:40:56 +0000 (23:40 -0800)
Bug: 6120953
Change-Id: I61d97d650c8dee0a6d7c19f2f50aa92a5f159095

libs/gui/BufferQueue.cpp

index 25a4c22..513a00e 100644 (file)
@@ -370,18 +370,13 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
                 }
             }
 
-            // we're in synchronous mode and didn't find a buffer, we need to
-            // wait for some buffers to be consumed
-            tryAgain = mSynchronousMode && (foundSync == INVALID_BUFFER_SLOT);
+            // if no buffer is found, wait for a buffer to be released
+            tryAgain = found == INVALID_BUFFER_SLOT;
             if (tryAgain) {
                 mDequeueCondition.wait(mMutex);
             }
         }
 
-        if (mSynchronousMode && found == INVALID_BUFFER_SLOT) {
-            // foundSync guaranteed to be != INVALID_BUFFER_SLOT
-            found = foundSync;
-        }
 
         if (found == INVALID_BUFFER_SLOT) {
             // This should not happen.