summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-06-06 07:54:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-06-06 07:54:50 +0000
commit75fdb2aab33c3a69874aa947c122a193250393dc (patch)
treeb05a9038336fe29752b2526f68be99b22657e551
parent5b16a6d467660891aa8b4a19bb0a5044dff9e1f2 (diff)
downloadrockbox-75fdb2aab33c3a69874aa947c122a193250393dc.tar.gz
rockbox-75fdb2aab33c3a69874aa947c122a193250393dc.zip
bug 749951, ooops. We made the number function too generic and forgot to
make the year tags work... Thanks to Jeremy Zoss for finding and reporting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3737 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/id3.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index ed0751d8d3..b6bdbac41d 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -108,12 +108,19 @@ struct tag_resolver {
108}; 108};
109 109
110/* parse numeric value from string */ 110/* parse numeric value from string */
111static int parsenum( struct mp3entry* entry, char* tag, int bufferpos ) 111static int parsetracknum( struct mp3entry* entry, char* tag, int bufferpos )
112{ 112{
113 entry->tracknum = atoi( tag ); 113 entry->tracknum = atoi( tag );
114 return bufferpos; 114 return bufferpos;
115} 115}
116 116
117/* parse numeric value from string */
118static int parseyearnum( struct mp3entry* entry, char* tag, int bufferpos )
119{
120 entry->year = atoi( tag );
121 return bufferpos;
122}
123
117/* parse numeric genre from string */ 124/* parse numeric genre from string */
118static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos ) 125static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
119{ 126{
@@ -134,9 +141,9 @@ static struct tag_resolver taglist[] = {
134 { "TIT2", 4, offsetof(struct mp3entry, title), NULL }, 141 { "TIT2", 4, offsetof(struct mp3entry, title), NULL },
135 { "TT2", 3, offsetof(struct mp3entry, title), NULL }, 142 { "TT2", 3, offsetof(struct mp3entry, title), NULL },
136 { "TALB", 4, offsetof(struct mp3entry, album), NULL }, 143 { "TALB", 4, offsetof(struct mp3entry, album), NULL },
137 { "TRCK", 4, offsetof(struct mp3entry, track_string), &parsenum }, 144 { "TRCK", 4, offsetof(struct mp3entry, track_string), &parsetracknum },
138 { "TYER", 4, offsetof(struct mp3entry, year_string), &parsenum }, 145 { "TYER", 4, offsetof(struct mp3entry, year_string), &parseyearnum },
139 { "TYR", 3, offsetof(struct mp3entry, year_string), &parsenum }, 146 { "TYR", 3, offsetof(struct mp3entry, year_string), &parseyearnum },
140 { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre }, 147 { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre },
141 { "TCOM", 4, offsetof(struct mp3entry, composer), NULL } 148 { "TCOM", 4, offsetof(struct mp3entry, composer), NULL }
142}; 149};