summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-01-18 00:05:14 +0000
committerJens Arnold <amiconn@rockbox.org>2006-01-18 00:05:14 +0000
commitb8749fdf219ffcfc17b7781217f388953268af49 (patch)
tree7369b5cb4f94f0c6589eb8bbf1bf63537c898b62 /uisimulator
parent507ff53c9c429de6c3bf5bfd6eb1a129cfc12cad (diff)
downloadrockbox-b8749fdf219ffcfc17b7781217f388953268af49.tar.gz
rockbox-b8749fdf219ffcfc17b7781217f388953268af49.tar.bz2
rockbox-b8749fdf219ffcfc17b7781217f388953268af49.zip
New codec loader, using the same mechanism as the new plugin loader. API version numbering restarted for the new system. Uses the target ID from configure, so don't change that too often. * Fixed sim_plugin_load_ram() to truncate the tempfile. * Reduced plugin buffer size to 512KB for iriver and iPod.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8362 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index 1871b29395..68eb8933a5 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -306,20 +306,20 @@ int sim_fsync(int fd)
void *sim_codec_load_ram(char* codecptr, int size,
void* ptr2, int bufwrap, int *pd_fd)
{
- void *pd;
- char *path = "archos/_temp_codec.dll";
- int (*codec_start)(void * api);
+ void *pd, *hdr;
+ const char *path = "archos/_temp_codec.dll";
int fd;
int copy_n;
#ifdef WIN32
char buf[256];
#endif
+ *pd_fd = 0;
+
/* We have to create the dynamic link library file from ram
- * so we could simulate the codec loading.
- */
- *pd_fd = -1;
- fd = open(path, O_WRONLY | O_CREAT, S_IRWXU);
+ so we could simulate the codec loading. */
+
+ fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU);
if (fd < 0) {
DEBUGF("failed to open for write: %s\n", path);
return NULL;
@@ -341,7 +341,7 @@ void *sim_codec_load_ram(char* codecptr, int size,
}
}
close(fd);
-
+
/* Now load the library. */
pd = dlopen(path, RTLD_NOW);
if (!pd) {
@@ -357,17 +357,12 @@ void *sim_codec_load_ram(char* codecptr, int size,
return NULL;
}
- codec_start = dlsym(pd, "codec_start");
- if (!codec_start) {
- codec_start = dlsym(pd, "_codec_start");
- if (!codec_start) {
- dlclose(pd);
- return NULL;
- }
- }
+ hdr = dlsym(pd, "__header");
+ if (!hdr)
+ hdr = dlsym(pd, "___header");
*pd_fd = (int)pd;
- return codec_start;
+ return hdr; /* maybe NULL if symbol not present */
}
void sim_codec_close(int pd)