diff options
author | Sultanxda <sultanxda@gmail.com> | 2015-11-06 21:03:32 -0800 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-02-17 22:57:34 +0200 |
commit | 2ecc5b98821c847162c865fb7d798da79b7699f4 (patch) | |
tree | 5d6204189b87e5c2afddf20f86cd7a8971a21058 /src/com | |
parent | 063146d46b7ca1b705bb826d1444f4386141f107 (diff) | |
download | android_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.tar.gz android_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.tar.bz2 android_packages_apps_Snap-2ecc5b98821c847162c865fb7d798da79b7699f4.zip |
SnapdragonCamera: Fix timelapse recording
Audio should not be encoded when the timelapse feature is used.
This fixes the force close when attempting to record a timelapse video.
Change-Id: I376372b316a7a75b0883e6c93eb1d827e4007a04
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 3ca6db31a..c87a797fd 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -1580,23 +1580,19 @@ public class VideoModule implements CameraModule, mProfile.audioCodec = mAudioEncoder; mProfile.duration = mMaxVideoDurationInMs; - // Set params individually for HFR case, as we do not want to encode audio - if ((isHFR || isHSR) && captureRate > 0) { - if (isHFR) { - mMediaRecorder.setOutputFormat(mProfile.fileFormat); - mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate); - mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate); - mMediaRecorder.setVideoEncoder(mProfile.videoCodec); - } else if (isHSR) { - mProfile.videoBitRate *= captureRate / 30; - mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); - mMediaRecorder.setProfile(mProfile); - } + // Set params individually for HFR and timelapse + // cases, as we do not want to encode audio + if (isHFR || mCaptureTimeLapse) { + mMediaRecorder.setOutputFormat(mProfile.fileFormat); + mMediaRecorder.setVideoFrameRate(mProfile.videoFrameRate); + mMediaRecorder.setVideoEncodingBitRate(mProfile.videoBitRate); + mMediaRecorder.setVideoEncoder(mProfile.videoCodec); + } else if (isHSR) { + mProfile.videoBitRate *= captureRate / 30; + mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); + mMediaRecorder.setProfile(mProfile); } else { - if (!mCaptureTimeLapse) { - mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); - } - + mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mMediaRecorder.setProfile(mProfile); } |