diff options
author | Robert Keevil <rkeevil+rockbox@gmail.com> | 2008-10-07 18:39:44 +0000 |
---|---|---|
committer | Robert Keevil <rkeevil+rockbox@gmail.com> | 2008-10-07 18:39:44 +0000 |
commit | 2c170356f38f5630b9fefdc5b1e7e57babb5cc40 (patch) | |
tree | 9ba565416427f76e6cf4754ef199ed02f804edf6 /firmware | |
parent | 7eb194477a19a12d76bceb64108ffad2da784c9f (diff) | |
download | rockbox-2c170356f38f5630b9fefdc5b1e7e57babb5cc40.tar.gz rockbox-2c170356f38f5630b9fefdc5b1e7e57babb5cc40.zip |
FS#9139 - support for ver 1.1 scrobbler log files. Upload any old files first - uploading software may need updating, see the LastFMLog wiki page
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18732 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/id3.h | 3 | ||||
-rw-r--r-- | firmware/id3.c | 28 |
2 files changed, 31 insertions, 0 deletions
diff --git a/firmware/export/id3.h b/firmware/export/id3.h index 3e4db0674f..da2faf1b12 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -223,6 +223,9 @@ struct mp3entry { | |||
223 | 223 | ||
224 | /* Cuesheet support */ | 224 | /* Cuesheet support */ |
225 | int cuesheet_type; /* 0: none, 1: external, 2: embedded */ | 225 | int cuesheet_type; /* 0: none, 1: external, 2: embedded */ |
226 | |||
227 | /* Musicbrainz Track ID */ | ||
228 | char* mb_track_id; | ||
226 | }; | 229 | }; |
227 | 230 | ||
228 | enum { | 231 | enum { |
diff --git a/firmware/id3.c b/firmware/id3.c index 3b7d165597..c1541e30df 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -486,6 +486,31 @@ static int parserva2( struct mp3entry* entry, char* tag, int bufferpos ) | |||
486 | } | 486 | } |
487 | #endif | 487 | #endif |
488 | 488 | ||
489 | static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos ) | ||
490 | { | ||
491 | char* value = NULL; | ||
492 | int desc_len = strlen(tag); | ||
493 | /*DEBUGF("MBID len: %d\n", desc_len);*/ | ||
494 | int value_len = 0; | ||
495 | |||
496 | if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) | ||
497 | { | ||
498 | value = tag + desc_len + 1; | ||
499 | |||
500 | if (strcasecmp(tag, "http://musicbrainz.org") == 0) | ||
501 | { | ||
502 | /* Musicbrainz track IDs are always 36 chars long plus null */ | ||
503 | value_len = 37; | ||
504 | |||
505 | entry->mb_track_id = value; | ||
506 | |||
507 | /*DEBUGF("ENTRY: %s LEN: %d\n", entry->mb_track_id, strlen(entry->mb_track_id));*/ | ||
508 | } | ||
509 | } | ||
510 | |||
511 | return tag - entry->id3v2buf + value_len; | ||
512 | } | ||
513 | |||
489 | static const struct tag_resolver taglist[] = { | 514 | static const struct tag_resolver taglist[] = { |
490 | { "TPE1", 4, offsetof(struct mp3entry, artist), NULL, false }, | 515 | { "TPE1", 4, offsetof(struct mp3entry, artist), NULL, false }, |
491 | { "TP1", 3, offsetof(struct mp3entry, artist), NULL, false }, | 516 | { "TP1", 3, offsetof(struct mp3entry, artist), NULL, false }, |
@@ -511,6 +536,7 @@ static const struct tag_resolver taglist[] = { | |||
511 | { "TXXX", 4, 0, &parseuser, false }, | 536 | { "TXXX", 4, 0, &parseuser, false }, |
512 | { "RVA2", 4, 0, &parserva2, true }, | 537 | { "RVA2", 4, 0, &parserva2, true }, |
513 | #endif | 538 | #endif |
539 | { "UFID", 4, 0, &parsembtid, false }, | ||
514 | }; | 540 | }; |
515 | 541 | ||
516 | #define TAGLIST_SIZE ((int)(sizeof(taglist) / sizeof(taglist[0]))) | 542 | #define TAGLIST_SIZE ((int)(sizeof(taglist) / sizeof(taglist[0]))) |
@@ -1261,6 +1287,8 @@ void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig) | |||
1261 | if (entry->album_gain_string) | 1287 | if (entry->album_gain_string) |
1262 | entry->album_gain_string += offset; | 1288 | entry->album_gain_string += offset; |
1263 | #endif | 1289 | #endif |
1290 | if (entry->mb_track_id) | ||
1291 | entry->mb_track_id += offset; | ||
1264 | } | 1292 | } |
1265 | 1293 | ||
1266 | void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig) | 1294 | void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig) |