diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-25 12:34:21 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-25 12:34:21 +0000 |
| commit | e4d1bda5e40a219a088fd391e195106fab516af9 (patch) | |
| tree | 9b1c842018a09a409e49f34689db28001052a25d | |
| parent | b7e92204e731695e0a19b84a93e0c47f5b796f62 (diff) | |
| download | rockbox-e4d1bda5e40a219a088fd391e195106fab516af9.zip rockbox-e4d1bda5e40a219a088fd391e195106fab516af9.tar.gz rockbox-e4d1bda5e40a219a088fd391e195106fab516af9.tar.bz2 rockbox-e4d1bda5e40a219a088fd391e195106fab516af9.tar.xz | |
For some strange reason, getsonglength() couldn't handle 800Kbyte ID3V2 tags :-)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2413 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/id3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/id3.c b/firmware/id3.c index a440661..d71ba2f 100644 --- a/firmware/id3.c +++ b/firmware/id3.c @@ -401,6 +401,7 @@ static int getsonglength(int fd, struct mp3entry *entry) int frequency; int chmode; int bytecount; + int bytelimit; int bittable; /* which bitrate table to use */ bool header_found = false; @@ -421,6 +422,7 @@ static int getsonglength(int fd, struct mp3entry *entry) /* Loop trough file until we find a frame header */ bytecount = entry->id3v2len - 1; + bytelimit = entry->id3v2len + 0x20000; restart: do { header <<= 8; @@ -430,7 +432,7 @@ static int getsonglength(int fd, struct mp3entry *entry) /* Quit if we haven't found a valid header within 128K */ bytecount++; - if(bytecount > 0x20000) + if(bytecount > bytelimit) return 0; } while(!mp3frameheader(header)); |