From 238bea737050f22007a06035cdd78c96beb50f06 Mon Sep 17 00:00:00 2001 From: Michiel Van Der Kolk Date: Thu, 28 Apr 2005 18:49:23 +0000 Subject: dumb dumb dumb dumb dumb..... some rearrangements of code.. bugs were in the tokentool tokenstream generator X.x.. dumb :/ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6380 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/searchengine/dbinterface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/plugins/searchengine/dbinterface.c') diff --git a/apps/plugins/searchengine/dbinterface.c b/apps/plugins/searchengine/dbinterface.c index 778a7ad..c9bbc12 100644 --- a/apps/plugins/searchengine/dbinterface.c +++ b/apps/plugins/searchengine/dbinterface.c @@ -87,8 +87,7 @@ void loadentry(int filerecord) { } void loadsongdata() { - if(currententry->loadedsongdata || - !currententry->loadedfiledata) + if(currententry->loadedsongdata) return; currententry->title=(char *)my_malloc(rb->tagdbheader->songlen); currententry->genre=(char *)my_malloc(rb->tagdbheader->genrelen); @@ -112,6 +111,9 @@ void loadartistname() { /* memory optimization possible, only malloc for an album name once, then * write that pointer to the entrys using it. */ + if(currententry->loadedartistname) + return; + loadsongdata(); currententry->artistname=(char *)my_malloc(rb->tagdbheader->artistlen); rb->lseek(*rb->tagdb_fd,currententry->artistoffset,SEEK_SET); rb->read(*rb->tagdb_fd,currententry->artistname,rb->tagdbheader->artistlen); @@ -120,6 +122,9 @@ void loadartistname() { void loadalbumname() { /* see the note at loadartistname */ + if(currententry->loadedalbumname) + return; + loadsongdata(); currententry->albumname=(char *)my_malloc(rb->tagdbheader->albumlen); rb->lseek(*rb->tagdb_fd,currententry->albumoffset,SEEK_SET); rb->read(*rb->tagdb_fd,currententry->albumname,rb->tagdbheader->albumlen); -- cgit v1.1