Re: remove_tag_from_mp3file()

Linus Walleij <[email protected]> Wed, 5 Oct 2005 21:29:38 +0200 (CEST)
Newsgroups gmane.comp.multimedia.libnjb.user
Message-ID <[email protected]>
On Wed, 5 Oct 2005, Terence Chan wrote:

> I recently upgraded to the latest versions gnomad2-2.8.1 and
> libnjb-2.2.3.

SO how come all Gnomad bugs and stuff get posted here on libnjb-devel... I 
don't mind, being coauthor of both but some of the other developers 
perhaps don't find it very interesting. There IS a gnomad mailinglist, I 
hope.

Anyway.

> the Creative Zen and possibly also when editing the header tags
> I get the following error message
>
> remove_tag_from_mp3file(): Bad header tag! Given length: 4208, detected length: 2160

Thing is: very many tag tools and libraries add erroneous tags to MP3 
files using ID3v2 tags. The tag length is incorrect, which is very bad 
when an app want to remove the tag: I could just remove the amount of 
bytes that the tag says it actually is, but if I scan for a sync mark (FFFB 
binary, a certain number of 1:s) I see that the tag is actually shorter. 
(ID3v2 is designed so that a sync mark can never appear inside a tag, so 
it is obviously the song starting, not just some data that looks like a 
sync mark).

I do not remove the number of bytes the file says the tag is, but the 
number of bytes it actually is.

For this reason I print out an error, becuase the file is bogus, but I 
fixed the bogus thing.

Perhaps I should also print out the filename so one knows which file 
had this error...

Linus


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl