From 607a2f0b99886cb07b2d2b042d38bfb26da0f166 Mon Sep 17 00:00:00 2001 From: likaid Date: Wed, 9 Sep 2015 10:40:27 +0800 Subject: SnapdragonCamera: limit video file size on SD card Videos over 4GB on SD card cannot be played correctly. Set a limit if video is stored on SD card. Change-Id: I9f658527c2f6ee4408b6f9c8c0b45e2b9ea9bf8b CRs-Fixed: 902533 --- src/com/android/camera/VideoModule.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 99e352c10..c8efd47e3 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -99,6 +99,8 @@ public class VideoModule implements CameraModule, private static final int SCREEN_DELAY = 2 * 60 * 1000; + private static final int SDCARD_SIZE_LIMIT = 4000 * 1024 * 1024; + private static final long SHUTTER_BUTTON_TIMEOUT = 0L; // 0ms /** @@ -1632,6 +1634,10 @@ public class VideoModule implements CameraModule, maxFileSize = requestedSizeLimit; } + if (Storage.isSaveSDCard() && maxFileSize > SDCARD_SIZE_LIMIT) { + maxFileSize = SDCARD_SIZE_LIMIT; + } + try { mMediaRecorder.setMaxFileSize(maxFileSize); } catch (RuntimeException exception) { -- cgit v1.2.3