Reset pendingCameraSwitch as false after failed to post switchCameraOnThread to camera thread.

BUG=webrtc:6981

Review-Url: https://codereview.webrtc.org/2625133007
Cr-Commit-Position: refs/heads/master@{#16105}
This commit is contained in:
hankzhang8945
2017-01-17 01:29:19 -08:00
committed by Commit bot
parent f4caaab518
commit 9506e12eba

View File

@ -184,8 +184,13 @@ public class VideoCapturerAndroid
}
}
});
if (!didPost && switchEventsHandler != null) {
switchEventsHandler.onCameraSwitchError("Camera is stopped.");
if (!didPost) {
synchronized (pendingCameraSwitchLock) {
pendingCameraSwitch = false;
}
if (switchEventsHandler != null) {
switchEventsHandler.onCameraSwitchError("Camera is stopped.");
}
}
}