From c2151f208379162fc1572b3125d3972ec8a8b1f2 Mon Sep 17 00:00:00 2001 From: Pannag Sanketi Date: Mon, 10 Oct 2011 18:20:42 -0700 Subject: Handle MediaRecorder stop exception for effects recording When recording videos with the effects ON, if user starts and stops the video in rapid succession, MediaRecorder stop can throw an exception, which we want to be treated separately than other runtime exceptions thrown by effectsrecorder. In this particular case, the idea is to keep the app running without crashing. Currently, all "Stop" exceptions will lead to the same behavior. In future, we might need to work out the details more to find out what caused the stop to crash and pass that up from the native layer and react according to the cause of the exception. Change-Id: I35a961d6cf4fc3cc3ca66870ea80ee16316f0728 --- src/com/android/camera/VideoCamera.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/com/android') diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index a880a01..c3bb830 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -76,6 +76,8 @@ import java.util.Date; import java.util.Iterator; import java.util.List; +import android.filterpacks.videosink.MediaRecorderStopException; + /** * The Camcorder activity. */ @@ -1924,6 +1926,10 @@ public class VideoCamera extends ActivityBase if (fileName != null && new File(fileName).exists()) { deleteVideoFile(fileName); } + if (exception instanceof MediaRecorderStopException) { + Log.w(TAG, "Problem recoding video file. Removing incomplete file."); + return; + } throw new RuntimeException("Error during recording!", exception); } -- cgit v1.1