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:
@ -410,7 +410,8 @@ public class VideoCapturerAndroid implements
|
|||||||
Throwable error = null;
|
Throwable error = null;
|
||||||
checkIsOnCameraThread();
|
checkIsOnCameraThread();
|
||||||
if (camera != null) {
|
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.applicationContext = applicationContext;
|
||||||
this.frameObserver = frameObserver;
|
this.frameObserver = frameObserver;
|
||||||
|
|||||||
Reference in New Issue
Block a user