Bug 1382681 - Remove java.lang.RuntimeException in VideoCaptureAndroid; r=jesup
authorDan Minor <dminor@mozilla.com>
Tue, 25 Jul 2017 11:31:26 -0400
changeset 422508 ad37214e0d8f3a4e34c3bf0244377eb062e65805
parent 422507 92c853365ed51fbdb68400a3823c58df69c17a70
child 422509 4335408842416a32f46657d1567c79ebad4ae049
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1382681
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1382681 - Remove java.lang.RuntimeException in VideoCaptureAndroid; r=jesup There does not seem to be any bad effects from calling stop twice, so just log that it has happened rather than throwing an exception.
media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
--- a/media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
@@ -270,17 +270,18 @@ public class VideoCaptureAndroid impleme
     cameraThread = null;
     Log.d(TAG, "stopCapture done");
     return status;
   }
 
   private void stopCaptureOnCameraThread(
       Exchanger<Boolean> result) {
     if (camera == null) {
-      throw new RuntimeException("Camera is already stopped!");
+      Log.e(TAG, "Camera is already stopped!");
+      return;
     }
     Throwable error = null;
     try {
       camera.stopPreview();
       camera.setPreviewCallbackWithBuffer(null);
       camera.setPreviewTexture(null);
       cameraSurfaceTexture = null;
       if (cameraGlTextures != null) {