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
This commit is contained in:
Daniel Stenberg 2005-06-27 21:23:03 +00:00
parent 4613659643
commit a24017f4da
18 changed files with 60 additions and 39 deletions

View file

@ -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");