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

Commit 155af760 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 7794b6cd d5523ea5
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;