Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb561921 authored by Vadim Caen's avatar Vadim Caen
Browse files

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
parent 3013feb2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2735,7 +2735,7 @@ status_t Surface::unlockAndPost()

bool Surface::waitForNextFrame(uint64_t lastFrame, nsecs_t timeout) {
    Mutex::Autolock lock(mMutex);
    if (mNextFrameNumber > lastFrame) {
    if (mLastFrameNumber > lastFrame) {
        return true;
    }
    return mQueueBufferCondition.waitRelative(mMutex, timeout) == OK;