summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-25 12:34:21 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-25 12:34:21 +0000
commite4d1bda5e40a219a088fd391e195106fab516af9 (patch)
tree9b1c842018a09a409e49f34689db28001052a25d
parentb7e92204e731695e0a19b84a93e0c47f5b796f62 (diff)
downloadrockbox-e4d1bda5e40a219a088fd391e195106fab516af9.tar.gz
rockbox-e4d1bda5e40a219a088fd391e195106fab516af9.zip
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index a4406616c3..d71ba2f4dd 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -401,6 +401,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
401 int frequency; 401 int frequency;
402 int chmode; 402 int chmode;
403 int bytecount; 403 int bytecount;
404 int bytelimit;
404 int bittable; /* which bitrate table to use */ 405 int bittable; /* which bitrate table to use */
405 bool header_found = false; 406 bool header_found = false;
406 407
@@ -421,6 +422,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
421 422
422 /* Loop trough file until we find a frame header */ 423 /* Loop trough file until we find a frame header */
423 bytecount = entry->id3v2len - 1; 424 bytecount = entry->id3v2len - 1;
425 bytelimit = entry->id3v2len + 0x20000;
424 restart: 426 restart:
425 do { 427 do {
426 header <<= 8; 428 header <<= 8;
@@ -430,7 +432,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
430 432
431 /* Quit if we haven't found a valid header within 128K */ 433 /* Quit if we haven't found a valid header within 128K */
432 bytecount++; 434 bytecount++;
433 if(bytecount > 0x20000) 435 if(bytecount > bytelimit)
434 return 0; 436 return 0;
435 } while(!mp3frameheader(header)); 437 } while(!mp3frameheader(header));
436 438