summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2005-08-13 08:09:28 +0000
committerMagnus Holmgren <magnushol@gmail.com>2005-08-13 08:09:28 +0000
commit501ab1a17f5570097ca75c93160ba5dfed337545 (patch)
treed7e3c93862f54ae47c1f51ae1d59460dd5d8bf43
parent15e0aeb73b6e4d2a92a71d3ba75da0ce8f78520d (diff)
downloadrockbox-501ab1a17f5570097ca75c93160ba5dfed337545.zip
rockbox-501ab1a17f5570097ca75c93160ba5dfed337545.tar.gz
rockbox-501ab1a17f5570097ca75c93160ba5dfed337545.tar.bz2
rockbox-501ab1a17f5570097ca75c93160ba5dfed337545.tar.xz
Support the LAME Info header too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7313 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/mp3data.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/firmware/mp3data.c b/firmware/mp3data.c
index 41265f9..260412b 100644
--- a/firmware/mp3data.c
+++ b/firmware/mp3data.c
@@ -406,11 +406,12 @@ int get_mp3file_info(int fd, struct mp3info *info)
vbrheader = frame + 17;
}
- if (!memcmp(vbrheader, "Xing", 4))
+ if (!memcmp(vbrheader, "Xing", 4)
+ || !memcmp(vbrheader, "Info", 4))
{
int i = 8; /* Where to start parsing info */
- DEBUGF("Xing header\n");
+ DEBUGF("Xing/Info header\n");
/* Remember where in the file the Xing header is */
info->vbr_header_pos = lseek(fd, 0, SEEK_CUR) - info->frame_size;
@@ -427,10 +428,9 @@ int get_mp3file_info(int fd, struct mp3info *info)
if(!mp3headerinfo(info, header))
return -5;
- /* Yes, it is a VBR file */
- info->is_vbr = true;
- info->is_xing_vbr = true;
-
+ /* Is it a VBR file? */
+ info->is_vbr = info->is_xing_vbr = !memcmp(vbrheader, "Xing", 4);
+
if(vbrheader[7] & VBR_FRAMES_FLAG) /* Is the frame count there? */
{
info->frame_count = BYTES2INT(vbrheader[i], vbrheader[i+1],
@@ -533,13 +533,6 @@ int get_mp3file_info(int fd, struct mp3info *info)
}
}
- /* Is it a LAME Info frame? */
- if (!memcmp(vbrheader, "Info", 4))
- {
- /* Make sure we skip this frame in playback */
- bytecount += info->frame_size;
- }
-
return bytecount;
}