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

Commit e4dd1c8e authored by Kwangkyu Park's avatar Kwangkyu Park
Browse files

Fix an issue that the syncTimestampToDisplayLocked incorrect

If the device turned on for a long time then the timestamp get biffer.
In this case, the conversion error between float<->nsecs_t also becomes
large enough to prevent the best timestamp selection. This causes frame
drops when timestamps get large enough.

Bug: 263096067
Test: Manual test after device is turned on for long time
Change-Id: I94c90b32a053f7c0c0816dadbef8a47e13c64b30
parent 6bb4ccf8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1526,7 +1526,8 @@ nsecs_t Camera3OutputStream::syncTimestampToDisplayLocked(nsecs_t t) {
                vsyncTime.deadlineTimestamp >= currentTime &&
                ((!cameraDisplayInSync && vsyncTime.expectedPresentationTime > minPresentT) ||
                 (cameraDisplayInSync && vsyncTime.expectedPresentationTime >
                mLastPresentTime + minInterval + biasForShortDelay * kTimelineThresholdNs))) {
                mLastPresentTime + minInterval +
                    static_cast<nsecs_t>(biasForShortDelay * kTimelineThresholdNs)))) {
            expectedPresentT = vsyncTime.expectedPresentationTime;
            minDiff = std::abs(vsyncTime.expectedPresentationTime - idealPresentT);
        }