summaryrefslogtreecommitdiff
path: root/apps/codecs.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-06-27 21:23:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-06-27 21:23:03 +0000
commita24017f4da1be50a43bd14db607205582abc7544 (patch)
tree16e3d6a2fc27e21a44238b3b647c50546e0bb5ce /apps/codecs.c
parent46136596433da25f3d802d72d0d1273a229c9d9f (diff)
downloadrockbox-a24017f4da1be50a43bd14db607205582abc7544.zip
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.gz
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.bz2
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.xz
Moved the codec and plugin buffer sizes to the config-*.h files instead of
having it repeated in numerous files where they all had to be updated to the same value if ever changed. This allows specific models to actually have its own buffer sizes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6901 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs.c')
-rw-r--r--apps/codecs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index da4b1f8..16338c2 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -16,6 +16,8 @@
* KIND, either express or implied.
*
****************************************************************************/
+#include "config.h"
+
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
@@ -52,7 +54,7 @@
#ifdef SIMULATOR
#if CONFIG_HWCODEC == MASNONE
-static unsigned char codecbuf[CODEC_BUFFER_SIZE];
+static unsigned char codecbuf[CODEC_SIZE];
#endif
void *sim_codec_load(char *plugin, int *fd);
void sim_codec_close(int fd);
@@ -251,9 +253,9 @@ int codec_load_ram(char* codecptr, size_t size, void* ptr2, size_t bufwrap)
if ((char *)&codecbuf[0] != codecptr) {
/* zero out codec buffer to ensure a properly zeroed bss area */
- memset(codecbuf, 0, CODEC_BUFFER_SIZE);
+ memset(codecbuf, 0, CODEC_SIZE);
- size = MIN(size, CODEC_BUFFER_SIZE);
+ size = MIN(size, CODEC_SIZE);
copy_n = MIN(size, bufwrap);
memcpy(codecbuf, codecptr, copy_n);
size -= copy_n;
@@ -283,7 +285,7 @@ int codec_load_file(const char *plugin)
return fd;
}
- rc = read(fd, &codecbuf[0], CODEC_BUFFER_SIZE);
+ rc = read(fd, &codecbuf[0], CODEC_SIZE);
close(fd);
if (rc <= 0) {
logf("Codec read error");