Skip to content

Commit c930cf3

Browse files
author
Daniel Lam
committed
BufferQueue: fixed issues with buffer slots not available
Bug: 6120953 Change-Id: Ief43f042ee9e1512e86fff8632a1c9dd31bdff35
1 parent 75d022a commit c930cf3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

libs/gui/BufferQueue.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,18 +370,13 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
370370
}
371371
}
372372

373-
// we're in synchronous mode and didn't find a buffer, we need to
374-
// wait for some buffers to be consumed
375-
tryAgain = mSynchronousMode && (foundSync == INVALID_BUFFER_SLOT);
373+
// if no buffer is found, wait for a buffer to be released
374+
tryAgain = found == INVALID_BUFFER_SLOT;
376375
if (tryAgain) {
377376
mDequeueCondition.wait(mMutex);
378377
}
379378
}
380379

381-
if (mSynchronousMode && found == INVALID_BUFFER_SLOT) {
382-
// foundSync guaranteed to be != INVALID_BUFFER_SLOT
383-
found = foundSync;
384-
}
385380

386381
if (found == INVALID_BUFFER_SLOT) {
387382
// This should not happen.

0 commit comments

Comments
 (0)