summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2006-06-17 09:42:16 +0000
committerHardeep Sidhu <dyp@pobox.com>2006-06-17 09:42:16 +0000
commit25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1 (patch)
treeb9f656e501f01e06abcb3f8703b26ca387577a83 /uisimulator
parent0916540d0658171a850507af02ed1fbc6b580cbe (diff)
downloadrockbox-25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1.tar.gz
rockbox-25377dbd7dcf702bb8bbcfb2384a43e8a0c090d1.tar.bz2
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
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c11
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)
#include <dlfcn.h>
#endif
+#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 *hdr;
- const char *path = "archos/_temp_codec.dll";
+ char path[MAX_PATH];
int fd;
int copy_n;
+ static int codec_count = 0;
#ifdef WIN32
char buf[256];
#endif
@@ -323,6 +326,12 @@ void *sim_codec_load_ram(char* codecptr, int size,
/* We have to create the dynamic link library file from ram
so we could simulate the codec loading. */
+ sprintf(path, TEMP_CODEC_FILE, codec_count);
+
+ /* if voice is enabled, two codecs may be loaded at same time */
+ if (!codec_count)
+ codec_count++;
+
#ifdef WIN32
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU);
#else