forked from len0rd/rockbox
test_codec: allocate wavbuffer/dspbuffer dynamically
It'll build on targets with small plugin buffer, the buffer for each of them will be a little smaller than 32kB. "should be enough" git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27050 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7aee79162b
commit
5c50021b90
1 changed files with 6 additions and 3 deletions
|
@ -159,9 +159,8 @@ static inline void int2le16(unsigned char* buf, int16_t x)
|
|||
buf[1] = (x & 0xff00) >> 8;
|
||||
}
|
||||
|
||||
/* 32KB should be enough */
|
||||
static unsigned char wavbuffer[32*1024];
|
||||
static unsigned char dspbuffer[32*1024];
|
||||
static unsigned char *wavbuffer;
|
||||
static unsigned char *dspbuffer;
|
||||
|
||||
void init_wav(char* filename)
|
||||
{
|
||||
|
@ -733,6 +732,7 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
char* ch;
|
||||
char dirpath[MAX_PATH];
|
||||
char filename[MAX_PATH];
|
||||
size_t buffer_size;
|
||||
|
||||
if (parameter == NULL)
|
||||
{
|
||||
|
@ -740,6 +740,9 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
return PLUGIN_ERROR;
|
||||
}
|
||||
|
||||
wavbuffer = rb->plugin_get_buffer(&buffer_size);
|
||||
dspbuffer = wavbuffer + buffer_size / 2;
|
||||
|
||||
codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize);
|
||||
audiobuf = SKIPBYTES(codec_mallocbuf, CODEC_SIZE);
|
||||
audiosize -= CODEC_SIZE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue