From 09ec3cf7c63f25a11679bcc3e01d5a51a4dff073 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Thu, 17 May 2018 16:15:59 +0200 Subject: [PATCH] Fix logic for camera check. Still run the test if webcam is found TBR: phoglund@webrtc.org No-Try: True Bug: chromium:755660 Change-Id: Iea1ae4a599a644aca18181f68fe155a659163766 Reviewed-on: https://webrtc-review.googlesource.com/77426 Commit-Queue: Oleh Prypin Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#23286} --- tools_webrtc/ensure_webcam_is_running.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools_webrtc/ensure_webcam_is_running.py b/tools_webrtc/ensure_webcam_is_running.py index 952ebd61b6..10153a1451 100755 --- a/tools_webrtc/ensure_webcam_is_running.py +++ b/tools_webrtc/ensure_webcam_is_running.py @@ -110,13 +110,14 @@ def _ForcePythonInterpreter(cmd): def Main(argv): - if IsWebCamRunning(): - return 0 - if not StartWebCam(): - return 1 + if not IsWebCamRunning(): + if not StartWebCam(): + return 1 if argv: return subprocess.call(_ForcePythonInterpreter(argv)) + else: + return 0 if __name__ == '__main__':