forked from len0rd/rockbox
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
This commit is contained in:
parent
5b16a6d467
commit
75fdb2aab3
1 changed files with 11 additions and 4 deletions
|
|
@ -108,12 +108,19 @@ struct tag_resolver {
|
|||
};
|
||||
|
||||
/* parse numeric value from string */
|
||||
static int parsenum( struct mp3entry* entry, char* tag, int bufferpos )
|
||||
static int parsetracknum( struct mp3entry* entry, char* tag, int bufferpos )
|
||||
{
|
||||
entry->tracknum = atoi( tag );
|
||||
return bufferpos;
|
||||
}
|
||||
|
||||
/* parse numeric value from string */
|
||||
static int parseyearnum( struct mp3entry* entry, char* tag, int bufferpos )
|
||||
{
|
||||
entry->year = atoi( tag );
|
||||
return bufferpos;
|
||||
}
|
||||
|
||||
/* parse numeric genre from string */
|
||||
static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
|
||||
{
|
||||
|
|
@ -134,9 +141,9 @@ static struct tag_resolver taglist[] = {
|
|||
{ "TIT2", 4, offsetof(struct mp3entry, title), NULL },
|
||||
{ "TT2", 3, offsetof(struct mp3entry, title), NULL },
|
||||
{ "TALB", 4, offsetof(struct mp3entry, album), NULL },
|
||||
{ "TRCK", 4, offsetof(struct mp3entry, track_string), &parsenum },
|
||||
{ "TYER", 4, offsetof(struct mp3entry, year_string), &parsenum },
|
||||
{ "TYR", 3, offsetof(struct mp3entry, year_string), &parsenum },
|
||||
{ "TRCK", 4, offsetof(struct mp3entry, track_string), &parsetracknum },
|
||||
{ "TYER", 4, offsetof(struct mp3entry, year_string), &parseyearnum },
|
||||
{ "TYR", 3, offsetof(struct mp3entry, year_string), &parseyearnum },
|
||||
{ "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre },
|
||||
{ "TCOM", 4, offsetof(struct mp3entry, composer), NULL }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue