From a997a5c30e56bf0fff526d7b8e36828e52fb9220 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Mon, 22 Aug 2016 19:38:06 +0300 Subject: [PATCH] increased v4l2-ctl timeout to 10 seconds --- motioneye/v4l2ctl.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/motioneye/v4l2ctl.py b/motioneye/v4l2ctl.py index 3e97de5..6fd4339 100644 --- a/motioneye/v4l2ctl.py +++ b/motioneye/v4l2ctl.py @@ -31,6 +31,7 @@ _ctrls_cache = {} _ctrl_values_cache = {} _DEV_V4L_BY_ID = '/dev/v4l/by-id/' +_V4L2_TIMEOUT = 10 def find_v4l2_ctl(): @@ -71,8 +72,8 @@ def list_devices(): logging.warn('v4l2-ctl command returned more than 10k of output') break - if time.time() - started > 3: - logging.warn('v4l2-ctl command ran for more than 3 seconds') + if time.time() - started > _V4L2_TIMEOUT: + logging.warn('v4l2-ctl command ran for more than %s seconds' % _V4L2_TIMEOUT) break except subprocess.CalledProcessError: @@ -144,8 +145,8 @@ def list_resolutions(device): logging.warn('v4l2-ctl command returned more than 10k of output') break - if time.time() - started > 3: - logging.warn('v4l2-ctl command ran for more than 3 seconds') + if time.time() - started > _V4L2_TIMEOUT: + logging.warn('v4l2-ctl command ran for more than %s seconds' % _V4L2_TIMEOUT) break try: -- 2.39.5