[xiph-cvs] cvs commit: positron/positron MP3Info.py
Stan Seibert
volsung at xiph.org
Tue Jun 3 19:42:38 PDT 2003
volsung 03/06/03 22:42:37
Modified: positron MP3Info.py
Log:
Round 642 in the ongoing battle between me and the hoards of strangely
formatted MP3s in the wild.
Revision Changes Path
1.5 +6 -4 positron/positron/MP3Info.py
Index: MP3Info.py
===================================================================
RCS file: /usr/local/cvsroot/positron/positron/MP3Info.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MP3Info.py 24 May 2003 22:50:47 -0000 1.4
+++ MP3Info.py 4 Jun 2003 02:42:37 -0000 1.5
@@ -270,7 +270,7 @@
_emphases = [ "none", "50/15 ms", "reserved", "CCIT J.17" ]
-_MP3_HEADER_SEEK_LIMIT = 102400
+_MP3_HEADER_SEEK_LIMIT = 4096
class MPEG:
def __init__(self, file, seeklimit=_MP3_HEADER_SEEK_LIMIT, seekstart=0):
@@ -437,10 +437,12 @@
self.id3 = id3
if id3v2.valid:
- self.mpeg = MPEG(file, seekstart=id3v2.header_size)
+ # We'll be generous for files with ID3v2 tags.
+ self.mpeg = MPEG(file, seekstart=id3v2.header_size,
+ seeklimit=10*_MP3_HEADER_SEEK_LIMIT)
else:
- # Header better be the first thing if there is no ID3v2
- self.mpeg = MPEG(file, seeklimit=4)
+ # Header better be near the beginning if there is no ID3v2
+ self.mpeg = MPEG(file)
if self.id3 is None:
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list