diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2008-10-30 19:00:24 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2008-10-30 19:00:24 +0000 |
commit | ee378abe636a99a86cd9a6b98f37c667bca1bd8f (patch) | |
tree | 47eb649ec0fbd154c62aae1263307b535f5851e5 | |
parent | 0ca8c44f9d9ca5c9b005bd10cb36ebd64003399e (diff) | |
download | rockbox-ee378abe636a99a86cd9a6b98f37c667bca1bd8f.tar.gz rockbox-ee378abe636a99a86cd9a6b98f37c667bca1bd8f.zip |
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.c | 22 |
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 ) | |||
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | #if CONFIG_CODEC == SWCODEC | 295 | /* parse user defined text, looking for album artist and replaygain |
296 | /* parse user defined text, looking for replaygain information. */ | 296 | * information. |
297 | */ | ||
297 | static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) | 298 | static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) |
298 | { | 299 | { |
299 | char* value = NULL; | 300 | char* value = NULL; |
@@ -305,13 +306,24 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) | |||
305 | * parse it | 306 | * parse it |
306 | */ | 307 | */ |
307 | value = tag + desc_len + 1; | 308 | value = tag + desc_len + 1; |
308 | value_len = parse_replaygain(tag, value, entry, tag, | 309 | value_len = bufferpos - (tag - entry->id3v2buf); |
309 | bufferpos - (tag - entry->id3v2buf)); | 310 | |
311 | if (!strcasecmp(tag, "ALBUM ARTIST")) { | ||
312 | strncpy(tag, value, value_len); | ||
313 | tag[value_len - 1] = 0; | ||
314 | entry->albumartist = tag; | ||
315 | #if CONFIG_CODEC == SWCODEC | ||
316 | } else { | ||
317 | value_len = parse_replaygain(tag, value, entry, tag, | ||
318 | value_len); | ||
319 | #endif | ||
320 | } | ||
310 | } | 321 | } |
311 | 322 | ||
312 | return tag - entry->id3v2buf + value_len; | 323 | return tag - entry->id3v2buf + value_len; |
313 | } | 324 | } |
314 | 325 | ||
326 | #if CONFIG_CODEC == SWCODEC | ||
315 | /* parse RVA2 binary data and convert to replaygain information. */ | 327 | /* parse RVA2 binary data and convert to replaygain information. */ |
316 | static int parserva2( struct mp3entry* entry, char* tag, int bufferpos ) | 328 | static int parserva2( struct mp3entry* entry, char* tag, int bufferpos ) |
317 | { | 329 | { |
@@ -427,8 +439,8 @@ static const struct tag_resolver taglist[] = { | |||
427 | { "COMM", 4, offsetof(struct mp3entry, comment), NULL, false }, | 439 | { "COMM", 4, offsetof(struct mp3entry, comment), NULL, false }, |
428 | { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre, false }, | 440 | { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre, false }, |
429 | { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre, false }, | 441 | { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre, false }, |
430 | #if CONFIG_CODEC == SWCODEC | ||
431 | { "TXXX", 4, 0, &parseuser, false }, | 442 | { "TXXX", 4, 0, &parseuser, false }, |
443 | #if CONFIG_CODEC == SWCODEC | ||
432 | { "RVA2", 4, 0, &parserva2, true }, | 444 | { "RVA2", 4, 0, &parserva2, true }, |
433 | #endif | 445 | #endif |
434 | { "UFID", 4, 0, &parsembtid, false }, | 446 | { "UFID", 4, 0, &parsembtid, false }, |