dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: RE: ID3V2 genre

RE: ID3V2 genre

From: Jeremy Zoss <>
Date: Sun, 22 Jun 2003 22:49:45 -0500

> Regarding the function parsegenre() in id3.c, shouldn't the "if"
> statement begin like this:
> if( tag[ 0 ] == '(' && tag[ 1 ] != '(' ) {
> entry->genre = atoi( tag + 1 );

Yup. The changes made in "generalizing" invalidated the old index-method
(although it was valid pre-generalization).

Quick explanation (hope I don't screw anything up ;D) --
Here's what frame headers look like, out of the id3v2 specs:
  v2.2 -- "T??" $aa aa aa bb <text> (6-byte "hdr", 1 byte enc,
???-byte text)
  v2.3 -- "T???" $aa aa aa aa bb bb cc <text> (10-byte "hdr", 1 byte end,
???-byte text)
  v2.4 -- same as 2.3

IIRC, rockbox initially parses out the 6/10-byte header, but not the
encoding byte. In the previous implementation, most tags
(title/artist/album) were passed through unicode_munge, which handles the
encoding byte correctly. Even year/tracknum numeric tags were first passed
through unicode_munge (which "cleaned out" the encoding byte) and then
through atoi. The genre-parsing code did not use unicode_munge, so had to
skip an extra byte (thus the tag[1] and tag[2] references).

In the current (generalized) id3v2 code, all id3v2 tags are sent through
unicode_munge, before the postprocessing function is called. So, now the
encoding byte is "cleaned out" of the genre string. So the correct
references are tag[0] and tag[1].

Probably more information than warranted. But it was on the tip of my
tounge, as I'm workign on my id3editor, so it just begged to be released.
So there ya go. =)
  - Jeremy
Received on 2003-06-23

Page was last modified "Mon Nov 16 10:57:21 2020" The Rockbox Crew -- Privacy Policy