Prakash Punnoor wrote:
/* Copyright 2005 by Prakash Punnoor */
void MixAudio16_NEW(ALshort *dst, alMixEntry *entries, int streams) {
int len = entries[0].bytes / sizeof(ALshort);
int offset;
int st;
int mod_len = len % 8;
static int out[1024];
>>
memset(out,0,len*sizeof(int));
I think here's no realistic guarantee that len is not going
to be more than 1024. This would be an ideal case for alloca(),
but there's no precedent for that in the SI source and
it's not really a standard function, sadly. A static
lazily-grown malloc'd buffer also probably isn't usable
because of thread-safety (and plain cleanliness), and malloc()ing
each time could be pretty slow. Perhaps if len>1024 you could
fall back to a simple and slow generalized routine.
--Adam
--
Adam D. Moss - adam@xxxxxxxx
|