LAME tags
Glenn Maynard <[email protected]>
| Newsgroups | gmane.comp.audio.mad.devel |
|---|---|
| Message-ID | <[email protected]> |
I've been writing a simple test set for decoding, and one failure (an extra frame of silence at the start) was files that have an "Info" tag instead of "Xing". LAME writes this in CBR mode (perhaps to avoid confusing apps that assume files with Xing tags are VBR). Fb2k's "fix MP3 header" command also writes this (for both CBR and VBR). -- Glenn Maynard
madplay-info.patch
(text/plain, 693 B)
--- madplay-0.15.0b~/xing.c 2003-05-30 02:26:18.000000000 -0400
+++ madplay-0.15.0b/xing.c 2004-01-23 21:35:32.000000000 -0500
@@ -30,6 +30,7 @@
# include "xing.h"
# define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')
+# define INFO_MAGIC (('I' << 24) | ('n' << 16) | ('f' << 8) | 'o')
/*
* NAME: xing->init()
@@ -46,7 +47,11 @@
*/
int xing_parse(struct xing *xing, struct mad_bitptr ptr, unsigned int bitlen)
{
- if (bitlen < 64 || mad_bit_read(&ptr, 32) != XING_MAGIC)
+ int magic;
+ if (bitlen < 64 )
+ goto fail;
+ magic = mad_bit_read(&ptr, 32);
+ if(magic != XING_MAGIC && magic != INFO_MAGIC)
goto fail;
xing->flags = mad_bit_read(&ptr, 32);