summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2008-10-30 19:00:24 +0000
committerMagnus Holmgren <magnushol@gmail.com>2008-10-30 19:00:24 +0000
commitee378abe636a99a86cd9a6b98f37c667bca1bd8f (patch)
tree47eb649ec0fbd154c62aae1263307b535f5851e5
parent0ca8c44f9d9ca5c9b005bd10cb36ebd64003399e (diff)
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
-rw-r--r--apps/metadata/mp3.c22
1 files changed, 17 insertions, 5 deletions
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 },