summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-19 09:03:16 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-19 09:03:16 +0000
commit2c6393737189055076481d2e5e503237ef8bf41a (patch)
tree167df842bdbe7b8c10c77a02e733b401c7be8fd2
parentc3eb83c6956672e4e639e66fba6f97acbcacd591 (diff)
downloadrockbox-2c6393737189055076481d2e5e503237ef8bf41a.tar.gz
rockbox-2c6393737189055076481d2e5e503237ef8bf41a.zip
Better handling of tagless tracks with VBR headers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2333 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index c7d8f762af..a4406616c3 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -402,6 +402,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
402 int chmode; 402 int chmode;
403 int bytecount; 403 int bytecount;
404 int bittable; /* which bitrate table to use */ 404 int bittable; /* which bitrate table to use */
405 bool header_found = false;
405 406
406 long bpf; 407 long bpf;
407 long tpf; 408 long tpf;
@@ -585,6 +586,8 @@ static int getsonglength(int fd, struct mp3entry *entry)
585 586
586 /* Make sure we skip this frame in playback */ 587 /* Make sure we skip this frame in playback */
587 bytecount += bpf; 588 bytecount += bpf;
589
590 header_found = true;
588 } 591 }
589 592
590 /* Is it a LAME Info frame? */ 593 /* Is it a LAME Info frame? */
@@ -595,6 +598,8 @@ static int getsonglength(int fd, struct mp3entry *entry)
595 { 598 {
596 /* Make sure we skip this frame in playback */ 599 /* Make sure we skip this frame in playback */
597 bytecount += bpf; 600 bytecount += bpf;
601
602 header_found = true;
598 } 603 }
599 604
600 605
@@ -613,7 +618,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
613 618
614 DEBUGF("Old ID3V2 length: %x\n", entry->id3v2len); 619 DEBUGF("Old ID3V2 length: %x\n", entry->id3v2len);
615 /* Adjust the tag length only if there is a tag present */ 620 /* Adjust the tag length only if there is a tag present */
616 if(entry->id3v2len) 621 if(entry->id3v2len || header_found)
617 entry->id3v2len = bytecount; 622 entry->id3v2len = bytecount;
618 DEBUGF("New ID3V2 length: %x\n", bytecount); 623 DEBUGF("New ID3V2 length: %x\n", bytecount);
619 624