summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliangche <liangchen@codeaurora.org>2014-07-28 15:17:05 +0800
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2014-10-20 22:21:03 +0000
commita380db3c10847a99e1613cf1bf265a56ad62368e (patch)
tree6f8d1dddf9dc8bb62b876302dc6628a295c64934
parent50d36b2b2126f69acf9036ee17e1739988b56a68 (diff)
downloadandroid_packages_apps_Camera2-a380db3c10847a99e1613cf1bf265a56ad62368e.tar.gz
android_packages_apps_Camera2-a380db3c10847a99e1613cf1bf265a56ad62368e.tar.bz2
android_packages_apps_Camera2-a380db3c10847a99e1613cf1bf265a56ad62368e.zip
Camera2: Fix video duration is wrong issue
When mMediaRecorderPausing is true, video duration is equal to mRecordingTotalTime, which can fix video duration is wrong issue if use pause/resume. Change-Id: I71d41414bba11564cfe84166fbc18608636a73d1
-rw-r--r--src/com/android/camera/VideoModule.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 242175079..19fe119aa 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1508,7 +1508,11 @@ public class VideoModule implements CameraModule,
private void saveVideo() {
if (mVideoFileDescriptor == null) {
- long duration = SystemClock.uptimeMillis() - mRecordingStartTime + mRecordingTotalTime;
+ long duration = 0L;
+ if (mMediaRecorderPausing == false)
+ duration = SystemClock.uptimeMillis() - mRecordingStartTime + mRecordingTotalTime;
+ else
+ duration = mRecordingTotalTime;
if (duration > 0) {
if (mCaptureTimeLapse) {
duration = getTimeLapseVideoLength(duration);
@@ -1813,6 +1817,7 @@ public class VideoModule implements CameraModule,
UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
fail ? UsageStatistics.ACTION_CAPTURE_FAIL :
UsageStatistics.ACTION_CAPTURE_DONE, "Video",
+ mMediaRecorderPausing ? mRecordingTotalTime :
SystemClock.uptimeMillis() - mRecordingStartTime + mRecordingTotalTime);
mStopRecPending = false;
return fail;