Skip to content

Commit ac3c337

Browse files
Jamie GennisAndroid (Google) Code Review
authored andcommitted
Merge "BufferQueue: fixed issues with buffer slots not available"
2 parents 2a2e613 + c930cf3 commit ac3c337

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
@@ -371,18 +371,13 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
371371
}
372372
}
373373

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

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

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

0 commit comments

Comments
 (0)