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

Commit c2d7b54b authored by Lajos Molnar's avatar Lajos Molnar Committed by android-build-merger
Browse files

Merge "media sync: forcefully limit correction by VideoFrameScheduler." into pi-dev am: 155af760

am: 1962cbc2

Change-Id: I7f07cbd49c82747b8387f5ce132e397cd2eee491
parents a4808c9c 1962cbc2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -475,7 +475,16 @@ nsecs_t VideoFrameScheduler::schedule(nsecs_t renderTime) {
                nextVsyncTime += mVsyncPeriod;
                if (vsyncsForLastFrame < ULONG_MAX)
                    ++vsyncsForLastFrame;
            } else if (mTimeCorrection < -correctionLimit * 2
                    || mTimeCorrection > correctionLimit * 2) {
                ALOGW("correction beyond limit: %lld vs %lld (vsyncs for last frame: %zu, min: %zu)"
                        " restarting. render=%lld",
                        (long long)mTimeCorrection, (long long)correctionLimit,
                        vsyncsForLastFrame, minVsyncsPerFrame, (long long)origRenderTime);
                restart();
                return origRenderTime;
            }

            ATRACE_INT("FRAME_VSYNCS", vsyncsForLastFrame);
        }
        mLastVsyncTime = nextVsyncTime;