summaryrefslogtreecommitdiff
path: root/apps/plugins/searchengine/dbinterface.c
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-04-28 18:49:23 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-04-28 18:49:23 +0000
commit238bea737050f22007a06035cdd78c96beb50f06 (patch)
tree5d3cd2ddd30d2bc5846dd3b7c9188db95d6305c8 /apps/plugins/searchengine/dbinterface.c
parent6752d1310d2ad37018c8b78614a2496d43c49301 (diff)
downloadrockbox-238bea737050f22007a06035cdd78c96beb50f06.zip
rockbox-238bea737050f22007a06035cdd78c96beb50f06.tar.gz
rockbox-238bea737050f22007a06035cdd78c96beb50f06.tar.bz2
rockbox-238bea737050f22007a06035cdd78c96beb50f06.tar.xz
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
Diffstat (limited to 'apps/plugins/searchengine/dbinterface.c')
-rw-r--r--apps/plugins/searchengine/dbinterface.c9
1 files changed, 7 insertions, 2 deletions
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);