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

Commit 93594b5a authored by James Dong's avatar James Dong
Browse files

Fix a hang issue where the first frame can be dropped for timelapse video recording.

Change-Id: I04754f1005a983953a80a659ff13f8762d0e120c
related-to-bug: 5523502
parent 71adab54
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -257,6 +257,12 @@ bool CameraSourceTimeLapse::skipFrameAndModifyTimeStamp(int64_t *timestampUs) {
            mForceRead = false;
            *timestampUs =
                mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs;

            // Really make sure that this video recording frame will not be dropped.
            if (*timestampUs < mStartTimeUs) {
                LOGI("set timestampUs to start time stamp %lld us", mStartTimeUs);
                *timestampUs = mStartTimeUs;
            }
            return false;
        }
    }