VideoCapturerAndroid: Ignore erroneous startCaptureOnCameraThread calls instead of crashing

Fix a bug where startCaptureOnCameraThread() is called while the camera is already successfully running. It may happen in the scenario when startCapture() is called, but startCaptureOnCameraThread() fails and posts a retry, then stopCapture() is called and removeCallbacksAndMessages() fails to remove the pending retry, and then startCapture() is called successfully.

BUG=b/28181364
R=glaznev@webrtc.org

Review URL: https://codereview.webrtc.org/1967053002 .

Cr-Commit-Position: refs/heads/master@{#12697}
This commit is contained in:
Magnus Jedvert
2016-05-12 12:40:28 +02:00
parent e38e4f6e48
commit 210dd5c361

View File

@ -410,7 +410,8 @@ public class VideoCapturerAndroid implements
Throwable error = null;
checkIsOnCameraThread();
if (camera != null) {
throw new RuntimeException("Camera has already been started.");
Logging.e(TAG, "startCaptureOnCameraThread: Camera has already been started.");
return;
}
this.applicationContext = applicationContext;
this.frameObserver = frameObserver;