Index: webrtc/sdk/android/api/org/webrtc/Camera2Session.java |
diff --git a/webrtc/sdk/android/api/org/webrtc/Camera2Session.java b/webrtc/sdk/android/api/org/webrtc/Camera2Session.java |
index 2552b2413e373263baf3e2039ed3617607f82726..a8e992d80229663f79a7c4ee7e49e374cec55d92 100644 |
--- a/webrtc/sdk/android/api/org/webrtc/Camera2Session.java |
+++ b/webrtc/sdk/android/api/org/webrtc/Camera2Session.java |
@@ -97,7 +97,7 @@ public class Camera2Session implements CameraSession { |
@Override |
public void onDisconnected(CameraDevice camera) { |
checkIsOnCameraThread(); |
- final boolean startFailure = (captureSession == null); |
+ final boolean startFailure = (captureSession == null) && (state != SessionState.STOPPED); |
state = SessionState.STOPPED; |
stopInternal(); |
if (startFailure) { |
@@ -402,7 +402,7 @@ public class Camera2Session implements CameraSession { |
checkIsOnCameraThread(); |
Logging.e(TAG, "Error: " + error); |
- final boolean startFailure = (captureSession == null); |
+ final boolean startFailure = (captureSession == null) && (state != SessionState.STOPPED); |
state = SessionState.STOPPED; |
stopInternal(); |
if (startFailure) { |