summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-27 08:21:23 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-27 08:21:23 +0000
commitacfacd938cfa878aeb69410532b2de58698f703a (patch)
tree181b2e04607c48ac8c6a377b48156185442351f9
parent321faba3eb7a6badf91829c17c3e1cedf0d8d248 (diff)
Rudimentary VBRI parsing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2435 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index d71ba2f4dd..0e7a5f227b 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -592,6 +592,35 @@ static int getsonglength(int fd, struct mp3entry *entry)
header_found = true;
}
+ if (xing[0] == 'V' &&
+ xing[1] == 'B' &&
+ xing[2] == 'R' &&
+ xing[3] == 'I')
+ {
+ int framecount;
+ int bytecount;
+
+ /* Yes, it is a FhG VBR file */
+ entry->vbr = true;
+ entry->vbrflags = 0;
+
+ bytecount = (xing[10] << 24) | (xing[11] << 16) |
+ (xing[12] << 8) | xing[13];
+
+ framecount = (xing[14] << 24) | (xing[15] << 16) |
+ (xing[16] << 8) | xing[17];
+
+ filetime = framecount * tpf;
+ bitrate = bytecount * 8 / filetime;
+
+ /* We don't parse the TOC, since we don't yet know how to (FIXME) */
+
+ /* Make sure we skip this frame in playback */
+ bytecount += bpf;
+
+ header_found = true;
+ }
+
/* Is it a LAME Info frame? */
if (xing[0] == 'I' &&
xing[1] == 'n' &&