Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b2debb5 authored by Mark Harman's avatar Mark Harman
Browse files

Move code to new videoRecordingStopped; limit catching RuntimeException to video_recorder.stop().

parent c6bc0001
Loading
Loading
Loading
Loading
+21 −16
Original line number Diff line number Diff line
@@ -804,9 +804,10 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
    		if( MyDebug.LOG )
    			Log.d(TAG, "stop video recording");
    		//this.phase = PHASE_NORMAL;
			try {
			video_recorder.setOnErrorListener(null);
			video_recorder.setOnInfoListener(null);

			try {
	    		if( MyDebug.LOG )
	    			Log.d(TAG, "about to call video_recorder.stop()");
				video_recorder.stop();
@@ -846,6 +847,11 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
    				applicationInterface.onVideoRecordStopError(profile);
    			}
			}
			videoRecordingStopped();
		}
	}
	
	private void videoRecordingStopped() {
		if( MyDebug.LOG )
			Log.d(TAG, "reset video_recorder");
		video_recorder.reset();
@@ -861,7 +867,6 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
		video_uri = null;
		video_filename = null;
	}
	}

	private Context getContext() {
		return applicationInterface.getContext();