summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorliangche <liangchen@codeaurora.org>2014-07-28 15:17:05 +0800
committersatyavaraprasad yerramsetti <satyav@codeaurora.org>2014-10-09 16:49:01 +0530
commit7c7446d8eff8191441405aad4506b2bb5d1f8e63 (patch)
tree3bc7a0bd16c634a0640b2fdfbd6e683fe25bdab3 /src/com/android/camera/VideoModule.java
parent755f42864e39aa6e5f8c2211fdb4380b3a50dc8a (diff)
downloadandroid_packages_apps_Snap-7c7446d8eff8191441405aad4506b2bb5d1f8e63.tar.gz
android_packages_apps_Snap-7c7446d8eff8191441405aad4506b2bb5d1f8e63.tar.bz2
android_packages_apps_Snap-7c7446d8eff8191441405aad4506b2bb5d1f8e63.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
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rwxr-xr-xsrc/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 226e50398..64bb41f51 100755
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1462,7 +1462,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);
@@ -1789,6 +1793,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;