Skip to content

Commit bb56192

Browse files
committed
Fix condition for waiting next frame
mNextFrameNumber is initiallized to 1. If we want to wait for the first frame to be drawn, one would expect to call mSurface.waitForNextFrame(0 /* lastFrame */), but since mNextFrameNumber is always greater then lastFrame, the method never waits. Test: N/A Bug: 376248818 Bug: 376828703 Flag: EXEMPT bug fix Change-Id: I8804479bad8102a441a95951ac27c1cc0711d7b0
1 parent 3013feb commit bb56192

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libs/gui/Surface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,8 +2735,8 @@ status_t Surface::unlockAndPost()
27352735

27362736
bool Surface::waitForNextFrame(uint64_t lastFrame, nsecs_t timeout) {
27372737
Mutex::Autolock lock(mMutex);
2738-
if (mNextFrameNumber > lastFrame) {
2739-
return true;
2738+
if (mLastFrameNumber > lastFrame) {
2739+
return true;
27402740
}
27412741
return mQueueBufferCondition.waitRelative(mMutex, timeout) == OK;
27422742
}

0 commit comments

Comments
 (0)