From: Calin Crisan Date: Sun, 8 Feb 2015 15:50:45 +0000 (+0200) Subject: non-modulo 16 resolutions are now discarded X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=ba71abbac3d0ab359e111d14bbd58f9d6f72c1f3;p=motioneye-debian non-modulo 16 resolutions are now discarded --- diff --git a/src/v4l2ctl.py b/src/v4l2ctl.py index 6c6e250..8aa455c 100644 --- a/src/v4l2ctl.py +++ b/src/v4l2ctl.py @@ -86,10 +86,16 @@ def list_resolutions(device): width, height = pair.split('x') width = int(width) height = int(height) - + + if (width, height) in resolutions: + continue # duplicate resolution + if width < 96 or height < 96: # some reasonable minimal values continue + if width % 16 or height % 16: # ignore non-modulo 16 resolutions + continue + resolutions.add((width, height)) logging.debug('found resolution %(width)sx%(height)s for device %(device)s' % {