Android: Guard against switching camera on stopped camera
It is possible that cameraThreadHandler is null upon calling switchCamera(). This CL adds a guard against that. Review URL: https://codereview.webrtc.org/1325333003 Cr-Commit-Position: refs/heads/master@{#9925}
This commit is contained in:
parent
c68700f717
commit
92068ee683
1
AUTHORS
1
AUTHORS
@ -40,5 +40,6 @@ MIPS Technologies
|
||||
Mozilla Foundation
|
||||
Opera Software ASA
|
||||
struktur AG
|
||||
Telenor Digital AS
|
||||
Temasys Communications
|
||||
Vonage Holdings Corp.
|
||||
|
||||
@ -168,9 +168,9 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba
|
||||
if (Camera.getNumberOfCameras() < 2 )
|
||||
return false;
|
||||
|
||||
if (cameraThread == null) {
|
||||
Log.e(TAG, "Camera has not been started");
|
||||
return false;
|
||||
if (cameraThreadHandler == null) {
|
||||
Log.e(TAG, "Calling switchCamera() for stopped camera.");
|
||||
return false;
|
||||
}
|
||||
if (pendingCameraSwitch) {
|
||||
// Do not handle multiple camera switch request to avoid blocking
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user