diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-06-17 09:42:16 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-06-17 09:42:16 +0000 |
commit | 25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1 (patch) | |
tree | b9f656e501f01e06abcb3f8703b26ca387577a83 | |
parent | 0916540d0658171a850507af02ed1fbc6b580cbe (diff) | |
download | rockbox-25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1.tar.gz rockbox-25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1.zip |
Simulator: two codecs may be loaded at same time if voice is enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10130 a1c6a512-1295-4272-9138-f99709370657
-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 |