summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libs/gui/BufferQueue.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index d93c067..41ee1be 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -995,7 +995,7 @@ void BufferQueue::freeAllBuffersExceptHeadLocked() {
}
status_t BufferQueue::drainQueueLocked() {
- while (mSynchronousMode && !mQueue.isEmpty()) {
+ while (mSynchronousMode && mQueue.size() > 1) {
mDequeueCondition.wait(mMutex);
if (mAbandoned) {
ST_LOGE("drainQueueLocked: BufferQueue has been abandoned!");
@@ -1012,7 +1012,7 @@ status_t BufferQueue::drainQueueLocked() {
status_t BufferQueue::drainQueueAndFreeBuffersLocked() {
status_t err = drainQueueLocked();
if (err == NO_ERROR) {
- if (mSynchronousMode) {
+ if (mQueue.empty()) {
freeAllBuffersLocked();
} else {
freeAllBuffersExceptHeadLocked();