]> www.vanbest.org Git - motioneye-debian/commitdiff
non-modulo 16 resolutions are now discarded
authorCalin Crisan <ccrisan@gmail.com>
Sun, 8 Feb 2015 15:50:45 +0000 (17:50 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 8 Feb 2015 15:50:45 +0000 (17:50 +0200)
src/v4l2ctl.py

index 6c6e2507b3244b95fc61bbd6b5df4b058ca844cd..8aa455c7d3ae6e67c0def032b01d3acd6d68a9a5 100644 (file)
@@ -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' % {