Author: tack
Date: Wed Mar 21 20:13:09 2007
New Revision: 2579

Modified:
   trunk/metadata/src/audio/eyeD3/tag.py

Log:
Slightly more robust.


Modified: trunk/metadata/src/audio/eyeD3/tag.py
==============================================================================
--- trunk/metadata/src/audio/eyeD3/tag.py       (original)
+++ trunk/metadata/src/audio/eyeD3/tag.py       Wed Mar 21 20:13:09 2007
@@ -1614,7 +1614,11 @@
          raise InvalidAudioFormatException("Unable to find a valid mp3 frame")
 
       # Seek back just before frame header, for Xing header detection.
-      f.seek(-4 + (offset - 32768 + 4) * (n_chunks > 0), 1)
+      try:
+          f.seek(-4 + (offset - 32768 + 4) * (n_chunks > 0), 1)
+      except IOError:
+         raise InvalidAudioFormatException("Unable to find a valid mp3 frame")
+        
 
       TRACE_MSG("mp3 header %x found at position: %d (0x%x)" % \
                 (frameHead, f.tell(), f.tell()));

-------------------------------------------------------------------------
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