diff options
Diffstat (limited to 'apps/codecs.c')
-rw-r--r-- | apps/codecs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/codecs.c b/apps/codecs.c index da4b1f8bff..16338c263c 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "config.h" | ||
20 | |||
19 | #include <stdbool.h> | 21 | #include <stdbool.h> |
20 | #include <string.h> | 22 | #include <string.h> |
21 | #include <stdio.h> | 23 | #include <stdio.h> |
@@ -52,7 +54,7 @@ | |||
52 | 54 | ||
53 | #ifdef SIMULATOR | 55 | #ifdef SIMULATOR |
54 | #if CONFIG_HWCODEC == MASNONE | 56 | #if CONFIG_HWCODEC == MASNONE |
55 | static unsigned char codecbuf[CODEC_BUFFER_SIZE]; | 57 | static unsigned char codecbuf[CODEC_SIZE]; |
56 | #endif | 58 | #endif |
57 | void *sim_codec_load(char *plugin, int *fd); | 59 | void *sim_codec_load(char *plugin, int *fd); |
58 | void sim_codec_close(int fd); | 60 | void sim_codec_close(int fd); |
@@ -251,9 +253,9 @@ int codec_load_ram(char* codecptr, size_t size, void* ptr2, size_t bufwrap) | |||
251 | 253 | ||
252 | if ((char *)&codecbuf[0] != codecptr) { | 254 | if ((char *)&codecbuf[0] != codecptr) { |
253 | /* zero out codec buffer to ensure a properly zeroed bss area */ | 255 | /* zero out codec buffer to ensure a properly zeroed bss area */ |
254 | memset(codecbuf, 0, CODEC_BUFFER_SIZE); | 256 | memset(codecbuf, 0, CODEC_SIZE); |
255 | 257 | ||
256 | size = MIN(size, CODEC_BUFFER_SIZE); | 258 | size = MIN(size, CODEC_SIZE); |
257 | copy_n = MIN(size, bufwrap); | 259 | copy_n = MIN(size, bufwrap); |
258 | memcpy(codecbuf, codecptr, copy_n); | 260 | memcpy(codecbuf, codecptr, copy_n); |
259 | size -= copy_n; | 261 | size -= copy_n; |
@@ -283,7 +285,7 @@ int codec_load_file(const char *plugin) | |||
283 | return fd; | 285 | return fd; |
284 | } | 286 | } |
285 | 287 | ||
286 | rc = read(fd, &codecbuf[0], CODEC_BUFFER_SIZE); | 288 | rc = read(fd, &codecbuf[0], CODEC_SIZE); |
287 | close(fd); | 289 | close(fd); |
288 | if (rc <= 0) { | 290 | if (rc <= 0) { |
289 | logf("Codec read error"); | 291 | logf("Codec read error"); |