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

Commit 1aaa9bad authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix divide by 0 for calculating vsyncs in buffer stuffing recovery" into main

parents ce3aadff 139146a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -930,8 +930,8 @@ public final class Choreographer {
            // of the next vsync event.
            int totalFrameDelays = mBufferStuffingData.numberFrameDelays
                    + mBufferStuffingData.numberWaitsForNextVsync + 1;
            long vsyncsSinceLastCallback =
                    (frameTimeNanos - mLastNoOffsetFrameTimeNanos) / mLastFrameIntervalNanos;
            long vsyncsSinceLastCallback = mLastFrameIntervalNanos > 0
                    ? (frameTimeNanos - mLastNoOffsetFrameTimeNanos) / mLastFrameIntervalNanos : 0;

            // Detected idle state due to a longer inactive period since the last vsync callback
            // than the total expected number of vsync frame delays. End buffer stuffing recovery.