Merge "Fix a hang issue where the first frame can be dropped for timelapse video recording." into ics-mr1
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 1ba79e5..e4de20a 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -257,6 +257,12 @@
             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;
         }
     }