summaryrefslogtreecommitdiffstats
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.tar.bz2
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)
int chmode;
int bytecount;
int bittable; /* which bitrate table to use */
+ bool header_found = false;
long bpf;
long tpf;
@@ -585,6 +586,8 @@ static int getsonglength(int fd, struct mp3entry *entry)
/* Make sure we skip this frame in playback */
bytecount += bpf;
+
+ header_found = true;
}
/* Is it a LAME Info frame? */
@@ -595,6 +598,8 @@ static int getsonglength(int fd, struct mp3entry *entry)
{
/* Make sure we skip this frame in playback */
bytecount += bpf;
+
+ header_found = true;
}
@@ -613,7 +618,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
DEBUGF("Old ID3V2 length: %x\n", entry->id3v2len);
/* Adjust the tag length only if there is a tag present */
- if(entry->id3v2len)
+ if(entry->id3v2len || header_found)
entry->id3v2len = bytecount;
DEBUGF("New ID3V2 length: %x\n", bytecount);