1
0
Fork 0
forked from len0rd/rockbox

revise commit r15463 - we still get the immediate display of runtime data in the wps, but avoid unnecessary calls while initialising/updating the database.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15781 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Kukla 2007-11-23 23:36:42 +00:00
parent ded6554cb0
commit a334bd2891
4 changed files with 5 additions and 14 deletions

View file

@ -26,9 +26,6 @@
#include "playback.h"
#include "debug.h"
#include "logf.h"
#ifdef HAVE_TAGCACHE
#include "tagtree.h"
#endif
#include "cuesheet.h"
#if CONFIG_CODEC == SWCODEC
@ -322,10 +319,6 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
lseek(fd, 0, SEEK_SET);
strncpy(id3->path, trackname, sizeof(id3->path));
#ifdef HAVE_TAGCACHE
tagtree_buffer_event(id3);
#endif
return true;
}

View file

@ -1698,6 +1698,9 @@ static bool audio_load_track(int offset, bool start_play)
{
if (get_metadata(&id3, fd, trackname))
{
if (track_buffer_callback)
track_buffer_callback(&id3);
tracks[track_widx].id3_hid =
bufalloc(&id3, sizeof(struct mp3entry), TYPE_ID3);
tracks[track_widx].taginfo_ready = (tracks[track_widx].id3_hid >= 0);
@ -1871,8 +1874,6 @@ static void audio_generate_postbuffer_events(void)
{
/* Mark the event 'sent' even if we don't really send one */
tracks[cur_idx].event_sent = true;
if (track_buffer_callback && tracks[cur_idx].id3_hid >= 0)
track_buffer_callback(bufgetid3(tracks[cur_idx].id3_hid));
}
if (cur_idx == track_widx)
break;

View file

@ -633,7 +633,7 @@ static int compare(const void *p1, const void *p2)
return strncasecmp(e1->name, e2->name, MAX_PATH);
}
void tagtree_buffer_event(struct mp3entry *id3)
static void tagtree_buffer_event(struct mp3entry *id3)
{
/* Do not gather data unless proper setting has been enabled. */
if (!global_settings.runtimedb)
@ -700,7 +700,7 @@ static void tagtree_unbuffer_event(struct mp3entry *id3)
logf("ube:%s", id3->path);
logf("-> %ld/%ld", playcount, playtime);
logf("-> %ld/%ld/%ld", id3->elapsed, id3->length, MIN(id3->length, id3->elapsed + 15 * 1000));
/* Queue the updates to the tagcache system. */
tagcache_update_numeric(id3->tagcache_idx, tag_playcount, playcount);
tagcache_update_numeric(id3->tagcache_idx, tag_playtime, playtime);
@ -921,9 +921,7 @@ void tagtree_init(void)
root_menu = 0;
uniqbuf = buffer_alloc(UNIQBUF_SIZE);
#if CONFIG_CODEC != SWCODEC
audio_set_track_buffer_event(tagtree_buffer_event);
#endif
audio_set_track_unbuffer_event(tagtree_unbuffer_event);
}

View file

@ -48,7 +48,6 @@ char *tagtree_get_title(struct tree_context* c);
int tagtree_get_attr(struct tree_context* c);
int tagtree_get_icon(struct tree_context* c);
int tagtree_get_filename(struct tree_context* c, char *buf, int buflen);
void tagtree_buffer_event(struct mp3entry *id3);
#endif
#endif