forked from len0rd/rockbox
Fix sims: sim_codec_load_ram() needed an update
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15411 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dd12c6c13e
commit
c70671b652
1 changed files with 2 additions and 15 deletions
|
|
@ -650,13 +650,11 @@ int sim_fsync(int fd)
|
|||
|
||||
#define TEMP_CODEC_FILE "archos/_temp_codec%d.dll"
|
||||
|
||||
void *sim_codec_load_ram(char* codecptr, int size,
|
||||
void* ptr2, int bufwrap, void **pd)
|
||||
void *sim_codec_load_ram(char* codecptr, int size, void **pd)
|
||||
{
|
||||
void *hdr;
|
||||
char path[MAX_PATH];
|
||||
int fd;
|
||||
int copy_n;
|
||||
int codec_count;
|
||||
#ifdef WIN32
|
||||
char buf[MAX_PATH];
|
||||
|
|
@ -682,21 +680,10 @@ void *sim_codec_load_ram(char* codecptr, int size,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (bufwrap == 0)
|
||||
bufwrap = size;
|
||||
|
||||
copy_n = bufwrap < size ? bufwrap : size;
|
||||
if (write(fd, codecptr, copy_n) != copy_n) {
|
||||
if (write(fd, codecptr, size) != size) {
|
||||
DEBUGF("write failed");
|
||||
return NULL;
|
||||
}
|
||||
size -= copy_n;
|
||||
if (size > 0) {
|
||||
if (write(fd, ptr2, size) != size) {
|
||||
DEBUGF("write failed [2]");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
|
||||
/* Now load the library. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue