From 64559c9a180c3f17722c9849bf8b6bc50cbd989b Mon Sep 17 00:00:00 2001 From: Praveen Chavan Date: Tue, 1 Sep 2015 16:38:10 -0700 Subject: Stagefright: Update start-time once input-time reaches expected start-time Not doing so will result in CameraSource always dropping frames since updated-timestamp (0-based) will never intersect start-timestamp (based on system-time). Change-Id: I696aef51398ed59be0bad7e0e6f9a85504c1f408 CRs-Fixed: 899460 --- media/libstagefright/CameraSourceTimeLapse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'media/libstagefright/CameraSourceTimeLapse.cpp') diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp index 873e473..926e95c 100644 --- a/media/libstagefright/CameraSourceTimeLapse.cpp +++ b/media/libstagefright/CameraSourceTimeLapse.cpp @@ -295,6 +295,12 @@ bool CameraSourceTimeLapse::skipFrameAndModifyTimeStamp(int64_t *timestampUs) { mLastTimeLapseFrameRealTimestampUs = *timestampUs; *timestampUs = mLastFrameTimestampUs + mTimeBetweenTimeLapseVideoFramesUs; + // Update start-time once the captured-time reaches the expected start-time. + // Not doing so will result in CameraSource always dropping frames since + // updated-timestamp will never intersect start-timestamp + if ((mNumFramesReceived == 0 && mLastTimeLapseFrameRealTimestampUs >= mStartTimeUs)) { + mStartTimeUs = *timestampUs; + } return false; } return false; -- cgit v1.1