diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-09-16 12:56:22 -0700 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2010-09-16 13:08:50 -0700 |
commit | f17b91d977b3ef91da6df83140776d93f2fa4e47 (patch) | |
tree | 686f94d93f635dde4546962b9213d9a314c234d2 /src | |
parent | c97d23826a28dd725951eccb62651244f9fb8228 (diff) | |
download | LegacyCamera-f17b91d977b3ef91da6df83140776d93f2fa4e47.zip LegacyCamera-f17b91d977b3ef91da6df83140776d93f2fa4e47.tar.gz LegacyCamera-f17b91d977b3ef91da6df83140776d93f2fa4e47.tar.bz2 |
Delete the video file if MediaRecorder.stop() throws an exception.
The file may be malformed and causes problems in decoding.
bug:2934606
Change-Id: I2864584c934455a5aa01f8fc6d732494dd7c2899
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index d617e4c..fb4e44a 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1304,14 +1304,15 @@ public class VideoCamera extends NoSearchActivity mMediaRecorder.setOnErrorListener(null); mMediaRecorder.setOnInfoListener(null); mMediaRecorder.stop(); + mCurrentVideoFilename = mVideoFilename; + Log.v(TAG, "Setting current video filename: " + + mCurrentVideoFilename); + needToRegisterRecording = true; } catch (RuntimeException e) { Log.e(TAG, "stop fail: " + e.getMessage()); + deleteVideoFile(mVideoFilename); } mHeadUpDisplay.setEnabled(true); - mCurrentVideoFilename = mVideoFilename; - Log.v(TAG, "Setting current video filename: " - + mCurrentVideoFilename); - needToRegisterRecording = true; mMediaRecorderRecording = false; } releaseMediaRecorder(); |