Author: tack
Date: Tue Jan  2 19:25:06 2007
New Revision: 2332

Modified:
   trunk/metadata/src/audio/pcm.py
   trunk/metadata/src/video/riff.py

Log:
Support in riff parser for wave files; .wav extension should go to the Riff
parser and not pcm.


Modified: trunk/metadata/src/audio/pcm.py
==============================================================================
--- trunk/metadata/src/audio/pcm.py     (original)
+++ trunk/metadata/src/audio/pcm.py     Tue Jan  2 19:25:06 2007
@@ -58,4 +58,4 @@
         return None
 
 
-core.register( 'application/pcm', ('wav','aif','voc','au'), PCM )
+core.register( 'application/pcm', ('aif','voc','au'), PCM )

Modified: trunk/metadata/src/video/riff.py
==============================================================================
--- trunk/metadata/src/video/riff.py    (original)
+++ trunk/metadata/src/video/riff.py    Tue Jan  2 19:25:06 2007
@@ -104,7 +104,7 @@
 
         self._find_subtitles(file.name)
 
-        if not self.has_idx:
+        if not self.has_idx and self.media == core.MEDIA_AV:
             log.debug('WARNING: avi has no index')
             self._set('corrupt', True)
 
@@ -538,6 +538,14 @@
                 file.seek(size-4, 1)
             # that's it, no new informations should be in AVIX
             return False
+        elif name == 'fmt ' and size <= 50:
+            # This is a wav file.
+            self.media = core.MEDIA_AUDIO
+            data = file.read(size)
+            fmt = struct.unpack("<HHLLHH", data[:16])
+            self._set('fourcc', fmt[0])
+            self._set('samplerate', fmt[2])
+            self._set('bitrate', fmt[3])
         elif not name.strip(string.printable + string.whitespace):
             # check if name is something usefull at all, maybe it is no
             # avi or broken
@@ -549,4 +557,4 @@
             return False
         return True
 
-core.register( 'video/avi', ('avi',), Riff )
+core.register( 'video/avi', ('wav','avi',), Riff )

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to