Commits

Anonymous committed 52efc25

Metadata: skip 'None' value, remove bit rate maximum limit, set max number of channel to 8

Comments (0)

Files changed (1)

hachoir-metadata/hachoir_metadata/metadata.py

 MAX_STR_LENGTH = 80*10            # 800 characters
 MAX_SAMPLE_RATE = 192000          # 192 kHz
 MAX_DURATION = 366*24*60*60*1000  # 1 year
-MAX_NB_CHANNEL = 1616 channels
+MAX_NB_CHANNEL = 8 8 channels
 MAX_WIDTH = 200000                # 200 000 pixels
 MAX_HEIGHT = MAX_WIDTH
 MAX_NB_COLOR = 2 ** 24            # 16 million of color
 MIN_YEAR = 1900                   # Year in 1900..2030
 MAX_YEAR = 2030
 MAX_FRAME_RATE = 150              # 150 frame/sec
-MAX_BIT_RATE = 500 * 1024 ** 2    # 500 Mbit/sec
 DATETIME_FILTER = Filter(datetime, datetime(MIN_YEAR, 1, 1), datetime(MAX_YEAR, 12, 31))
 
 extractors = {}
         self.register("frame_rate", 603, _("Frame rate"),
             filter=NumberFilter(1, MAX_FRAME_RATE))
         self.register("bit_rate", 604, _("Bit rate"), handler=humanBitRate,
-            filter=NumberFilter(1, MAX_BIT_RATE))
+            filter=NumberFilter(1))
         self.register("aspect_ratio", 604, _("Aspect ratio"))
 
         self.register("producer", 901, _("Producer"))
         if key not in self.__data:
             raise KeyError(_("%s has no metadata '%s'") % (self.__class__.__name__, key))
 
+        # Skip value 'None'
+        if value is None:
+            return
+
         # Convert string to Unicode string using charset ISO-8859-1
         if isinstance(value, str):
             value = unicode(value, "ISO-8859-1")