From ee378abe636a99a86cd9a6b98f37c667bca1bd8f Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Thu, 30 Oct 2008 19:00:24 +0000 Subject: Add support for the album artist field used by Foobar2000 in ID3v2 tags. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18935 a1c6a512-1295-4272-9138-f99709370657 --- apps/metadata/mp3.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'apps/metadata/mp3.c') diff --git a/apps/metadata/mp3.c b/apps/metadata/mp3.c index 2401e03a6c..0a4592be93 100644 --- a/apps/metadata/mp3.c +++ b/apps/metadata/mp3.c @@ -292,8 +292,9 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos ) } } -#if CONFIG_CODEC == SWCODEC -/* parse user defined text, looking for replaygain information. */ +/* parse user defined text, looking for album artist and replaygain + * information. + */ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) { char* value = NULL; @@ -305,13 +306,24 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) * parse it */ value = tag + desc_len + 1; - value_len = parse_replaygain(tag, value, entry, tag, - bufferpos - (tag - entry->id3v2buf)); + value_len = bufferpos - (tag - entry->id3v2buf); + + if (!strcasecmp(tag, "ALBUM ARTIST")) { + strncpy(tag, value, value_len); + tag[value_len - 1] = 0; + entry->albumartist = tag; +#if CONFIG_CODEC == SWCODEC + } else { + value_len = parse_replaygain(tag, value, entry, tag, + value_len); +#endif + } } return tag - entry->id3v2buf + value_len; } +#if CONFIG_CODEC == SWCODEC /* parse RVA2 binary data and convert to replaygain information. */ static int parserva2( struct mp3entry* entry, char* tag, int bufferpos ) { @@ -427,8 +439,8 @@ static const struct tag_resolver taglist[] = { { "COMM", 4, offsetof(struct mp3entry, comment), NULL, false }, { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre, false }, { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre, false }, -#if CONFIG_CODEC == SWCODEC { "TXXX", 4, 0, &parseuser, false }, +#if CONFIG_CODEC == SWCODEC { "RVA2", 4, 0, &parserva2, true }, #endif { "UFID", 4, 0, &parsembtid, false }, -- cgit v1.2.3