1
0
Fork 0
forked from len0rd/rockbox

Support the LAME Info header too.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7313 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Magnus Holmgren 2005-08-13 08:09:28 +00:00
parent 15e0aeb73b
commit 501ab1a17f

View file

@ -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,9 +428,8 @@ 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? */
{
@ -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;
}