replace alloca with malloc to fix windows builds

This commit is contained in:
Tetsuo55 2013-06-22 22:44:27 +02:00
parent 1bd80d781c
commit 02351b77f9
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const
{ {
uint i, j, end, c; uint i, j, end, c;
LONG_SAMPLETYPE *sum=(LONG_SAMPLETYPE*)alloca(numChannels*sizeof(*sum)); LONG_SAMPLETYPE *sum=(LONG_SAMPLETYPE*)malloc(numChannels*sizeof(*sum));
#ifdef SOUNDTOUCH_FLOAT_SAMPLES #ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider // when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying. // because division is much slower operation than multiplying.

View File

@ -348,7 +348,7 @@ void SoundTouch::flush()
int i; int i;
int nUnprocessed; int nUnprocessed;
int nOut; int nOut;
SAMPLETYPE *buff=(SAMPLETYPE*)alloca(64*channels*sizeof(SAMPLETYPE)); SAMPLETYPE *buff=(SAMPLETYPE*)malloc(64*channels*sizeof(SAMPLETYPE));
// check how many samples still await processing, and scale // check how many samples still await processing, and scale
// that by tempo & rate to get expected output sample count // that by tempo & rate to get expected output sample count