summaryrefslogtreecommitdiff
path: root/firmware/id3.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2007-02-10 12:09:28 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2007-02-10 12:09:28 +0000
commit4e9766477b37579bfa0249fa17818da8d348db7f (patch)
tree0fceae7fd07d436285ae3605621585b58535919d /firmware/id3.c
parent7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1 (diff)
FS#6638 - Album artist and comment patch for WPS and tagcache. Export
your database before updating because initialization is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12255 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/id3.c')
-rw-r--r--firmware/id3.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index bc42cf5c62..bdcf8e526b 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -351,6 +351,14 @@ static int parseyearnum( struct mp3entry* entry, char* tag, int bufferpos )
return bufferpos;
}
+/* parse comment */
+static int parsecomment( struct mp3entry* entry, char* tag, int bufferpos )
+{
+
+ entry->comment = tag + 4; // simplistic
+ return bufferpos;
+}
+
/* parse numeric genre from string, version 2.2 and 2.3 */
static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
{
@@ -448,6 +456,9 @@ static const struct tag_resolver taglist[] = {
{ "TYER", 4, offsetof(struct mp3entry, year_string), &parseyearnum, false },
{ "TYE", 3, offsetof(struct mp3entry, year_string), &parseyearnum, false },
{ "TCOM", 4, offsetof(struct mp3entry, composer), NULL, false },
+ { "TPE2", 4, offsetof(struct mp3entry, albumartist), NULL, false },
+ { "TP2", 3, offsetof(struct mp3entry, albumartist), NULL, false },
+ { "COMM", 4, offsetof(struct mp3entry, comment), &parsecomment, false },
{ "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre, false },
{ "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre, false },
#if CONFIG_CODEC == SWCODEC
@@ -1151,6 +1162,10 @@ void adjust_mp3entry(struct mp3entry *entry, void *dest, void *orig)
entry->year_string += offset;
if (entry->composer)
entry->composer += offset;
+ if (entry->comment)
+ entry->comment += offset;
+ if (entry->albumartist)
+ entry->albumartist += offset;
#if CONFIG_CODEC == SWCODEC
if (entry->track_gain_string)
entry->track_gain_string += offset;