From ba71abbac3d0ab359e111d14bbd58f9d6f72c1f3 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 8 Feb 2015 17:50:45 +0200 Subject: [PATCH] non-modulo 16 resolutions are now discarded --- src/v4l2ctl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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' % { -- 2.39.5