diff options
-rw-r--r-- | uisimulator/common/io.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 9115ef29e1..e3ebe88a21 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -307,13 +307,16 @@ int sim_fsync(int fd) | |||
307 | #include <dlfcn.h> | 307 | #include <dlfcn.h> |
308 | #endif | 308 | #endif |
309 | 309 | ||
310 | #define TEMP_CODEC_FILE "archos/_temp_codec%d.dll" | ||
311 | |||
310 | void *sim_codec_load_ram(char* codecptr, int size, | 312 | void *sim_codec_load_ram(char* codecptr, int size, |
311 | void* ptr2, int bufwrap, void **pd) | 313 | void* ptr2, int bufwrap, void **pd) |
312 | { | 314 | { |
313 | void *hdr; | 315 | void *hdr; |
314 | const char *path = "archos/_temp_codec.dll"; | 316 | char path[MAX_PATH]; |
315 | int fd; | 317 | int fd; |
316 | int copy_n; | 318 | int copy_n; |
319 | static int codec_count = 0; | ||
317 | #ifdef WIN32 | 320 | #ifdef WIN32 |
318 | char buf[256]; | 321 | char buf[256]; |
319 | #endif | 322 | #endif |
@@ -323,6 +326,12 @@ void *sim_codec_load_ram(char* codecptr, int size, | |||
323 | /* We have to create the dynamic link library file from ram | 326 | /* We have to create the dynamic link library file from ram |
324 | so we could simulate the codec loading. */ | 327 | so we could simulate the codec loading. */ |
325 | 328 | ||
329 | sprintf(path, TEMP_CODEC_FILE, codec_count); | ||
330 | |||
331 | /* if voice is enabled, two codecs may be loaded at same time */ | ||
332 | if (!codec_count) | ||
333 | codec_count++; | ||
334 | |||
326 | #ifdef WIN32 | 335 | #ifdef WIN32 |
327 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU); | 336 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU); |
328 | #else | 337 | #else |