Extend lc_open() to also being able to load overlay plugins.

For this it needs to look at the plugin header. Since lc_open() doesn't know
it's a plugin, the header needs to be changed slightly to include the new lc_header (which needs to be the first element in plugin_header so it can be casted savely).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28054 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-09-09 16:17:21 +00:00
parent cec7c99613
commit 0d4585b28f
10 changed files with 167 additions and 105 deletions

View file

@ -181,7 +181,8 @@ void codec_get_full_path(char *path, const char *codec_root_fn)
static int codec_load_ram(void *handle, struct codec_api *api)
{
struct codec_header *hdr = lc_get_header(handle);
struct codec_header *c_hdr = lc_get_header(handle);
struct lc_header *hdr = c_hdr ? &c_hdr->lc_hdr : NULL;
int status;
if (hdr == NULL
@ -215,8 +216,8 @@ static int codec_load_ram(void *handle, struct codec_api *api)
codec_size = 0;
#endif
*(hdr->api) = api;
status = hdr->entry_point();
*(c_hdr->api) = api;
status = c_hdr->entry_point();
lc_close(handle);