From 70c0791c7c3f5c25a6e91a107ec566abb6d77ceb Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Mon, 3 Apr 2006 06:00:56 +0000 Subject: Fill the numeric tags. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9448 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagcache.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 3745d07049..6567a781f8 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -678,11 +678,16 @@ void tagcache_search_finish(struct tagcache_search *tcs) } #ifdef HAVE_TC_RAMCACHE -static struct tagfile_entry *get_tag(struct index_entry *entry, int tag) +static struct tagfile_entry *get_tag(const struct index_entry *entry, int tag) { return (struct tagfile_entry *)&hdr->tags[tag][entry->tag_seek[tag]]; } +static long get_tag_numeric(const struct index_entry *entry, int tag) +{ + return entry->tag_seek[tag]; +} + bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) { struct index_entry *entry; @@ -697,6 +702,11 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) id3->album = get_tag(entry, tag_album)->tag_data; id3->genre_string = get_tag(entry, tag_genre)->tag_data; id3->composer = get_tag(entry, tag_composer)->tag_data; + id3->year = get_tag_numeric(entry, tag_year); + id3->tracknum = get_tag_numeric(entry, tag_tracknumber); + id3->bitrate = get_tag_numeric(entry, tag_bitrate); + if (id3->bitrate == 0) + id3->bitrate = 1; return true; } -- cgit v1.2.3