Skip to content

Commit b888fd1

Browse files
author
James Dong
committed
Fix a hang issue where the first frame can be dropped for timelapse video recording.
Change-Id: I04754f1005a983953a80a659ff13f8762d0e120c related-to-bug: 5523502
1 parent 27812a8 commit b888fd1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

media/libstagefright/CameraSourceTimeLapse.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ bool CameraSourceTimeLapse::skipFrameAndModifyTimeStamp(int64_t *timestampUs) {
257257
mForceRead = false;
258258
*timestampUs =
259259
mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs;
260+
261+
// Really make sure that this video recording frame will not be dropped.
262+
if (*timestampUs < mStartTimeUs) {
263+
LOGI("set timestampUs to start time stamp %lld us", mStartTimeUs);
264+
*timestampUs = mStartTimeUs;
265+
}
260266
return false;
261267
}
262268
}

0 commit comments

Comments
 (0)