diff options
Diffstat (limited to 'apps/codecs.c')
-rw-r--r-- | apps/codecs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/codecs.c b/apps/codecs.c index 46d9223560..22e692c111 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -54,20 +54,20 @@ | |||
54 | #define LOGF_ENABLE | 54 | #define LOGF_ENABLE |
55 | #include "logf.h" | 55 | #include "logf.h" |
56 | 56 | ||
57 | #ifdef SIMULATOR | 57 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
58 | #define PREFIX(_x_) sim_ ## _x_ | ||
59 | #else | ||
60 | #define PREFIX | ||
61 | #endif | ||
62 | 58 | ||
63 | #ifdef SIMULATOR | 59 | #define PREFIX(_x_) sim_ ## _x_ |
64 | #if CONFIG_CODEC == SWCODEC | 60 | #if CONFIG_CODEC == SWCODEC |
65 | unsigned char codecbuf[CODEC_SIZE]; | 61 | unsigned char codecbuf[CODEC_SIZE]; |
66 | #endif | 62 | #endif |
67 | void *sim_codec_load_ram(char* codecptr, int size, void **pd); | 63 | void *sim_codec_load_ram(char* codecptr, int size, void **pd); |
68 | void sim_codec_close(void *pd); | 64 | void sim_codec_close(void *pd); |
69 | #else | 65 | |
66 | #else /* !PLATFORM_HOSTED */ | ||
67 | |||
68 | #define PREFIX | ||
70 | #define sim_codec_close(x) | 69 | #define sim_codec_close(x) |
70 | |||
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | size_t codec_size; | 73 | size_t codec_size; |
@@ -77,7 +77,7 @@ extern void* plugin_get_audio_buffer(size_t *buffer_size); | |||
77 | #undef open | 77 | #undef open |
78 | static int open(const char* pathname, int flags, ...) | 78 | static int open(const char* pathname, int flags, ...) |
79 | { | 79 | { |
80 | #ifdef SIMULATOR | 80 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) |
81 | int fd; | 81 | int fd; |
82 | if (flags & O_CREAT) | 82 | if (flags & O_CREAT) |
83 | { | 83 | { |
@@ -201,7 +201,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
201 | { | 201 | { |
202 | struct codec_header *hdr; | 202 | struct codec_header *hdr; |
203 | int status; | 203 | int status; |
204 | #ifndef SIMULATOR | 204 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
205 | hdr = (struct codec_header *)codecbuf; | 205 | hdr = (struct codec_header *)codecbuf; |
206 | 206 | ||
207 | if (size <= (signed)sizeof(struct codec_header) | 207 | if (size <= (signed)sizeof(struct codec_header) |
@@ -220,7 +220,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
220 | 220 | ||
221 | codec_size = hdr->end_addr - codecbuf; | 221 | codec_size = hdr->end_addr - codecbuf; |
222 | 222 | ||
223 | #else /* SIMULATOR */ | 223 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) |
224 | void *pd; | 224 | void *pd; |
225 | 225 | ||
226 | hdr = sim_codec_load_ram(codecbuf, size, &pd); | 226 | hdr = sim_codec_load_ram(codecbuf, size, &pd); |
@@ -241,7 +241,7 @@ static int codec_load_ram(int size, struct codec_api *api) | |||
241 | 241 | ||
242 | codec_size = codecbuf - codecbuf; | 242 | codec_size = codecbuf - codecbuf; |
243 | 243 | ||
244 | #endif /* SIMULATOR */ | 244 | #endif /* CONFIG_PLATFORM */ |
245 | if (hdr->api_version > CODEC_API_VERSION | 245 | if (hdr->api_version > CODEC_API_VERSION |
246 | || hdr->api_version < CODEC_MIN_API_VERSION) { | 246 | || hdr->api_version < CODEC_MIN_API_VERSION) { |
247 | sim_codec_close(pd); | 247 | sim_codec_close(pd); |