forked from len0rd/rockbox
Suggested by Thomas Martitz, use tagcache_fill_tags to speed up PictureFlow album art search a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21110 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dda7580f8a
commit
34589f6ccb
3 changed files with 20 additions and 4 deletions
|
|
@ -648,6 +648,9 @@ static const struct plugin_api rockbox_api = {
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
action_get_touchscreen_press,
|
action_get_touchscreen_press,
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_TAGCACHE) && defined(HAVE_TC_RAMCACHE)
|
||||||
|
tagcache_fill_tags
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int plugin_load(const char* plugin, const void* parameter)
|
int plugin_load(const char* plugin, const void* parameter)
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ void* plugin_get_buffer(size_t *buffer_size);
|
||||||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||||
|
|
||||||
/* increase this every time the api struct changes */
|
/* increase this every time the api struct changes */
|
||||||
#define PLUGIN_API_VERSION 152
|
#define PLUGIN_API_VERSION 153
|
||||||
|
|
||||||
/* update this to latest version if a change to the api struct breaks
|
/* update this to latest version if a change to the api struct breaks
|
||||||
backwards compatibility (and please take the opportunity to sort in any
|
backwards compatibility (and please take the opportunity to sort in any
|
||||||
|
|
@ -810,6 +810,9 @@ struct plugin_api {
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
int (*action_get_touchscreen_press)(short *x, short *y);
|
int (*action_get_touchscreen_press)(short *x, short *y);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_TAGCACHE) && defined(HAVE_TC_RAMCACHE)
|
||||||
|
bool (*tagcache_fill_tags)(struct mp3entry *id3, const char *filename);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* plugin header */
|
/* plugin header */
|
||||||
|
|
|
||||||
|
|
@ -879,9 +879,19 @@ bool get_albumart_for_index_from_db(const int slide_index, char *buf,
|
||||||
struct mp3entry id3;
|
struct mp3entry id3;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = rb->open(tcs.result, O_RDONLY);
|
#ifdef HAVE_TC_RAMCACHE
|
||||||
rb->get_metadata(&id3, fd, tcs.result);
|
if (rb->tagcache_fill_tags(&id3, tcs.result))
|
||||||
rb->close(fd);
|
{
|
||||||
|
rb->strncpy(id3.path, tcs.result, sizeof(id3.path));
|
||||||
|
id3.path[sizeof(id3.path) - 1] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
fd = rb->open(tcs.result, O_RDONLY);
|
||||||
|
rb->get_metadata(&id3, fd, tcs.result);
|
||||||
|
rb->close(fd);
|
||||||
|
}
|
||||||
if ( search_albumart_files(&id3, "", buf, buflen) )
|
if ( search_albumart_files(&id3, "", buf, buflen) )
|
||||||
result = true;
|
result = true;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue