From 0d26b0dcc2ed3c73bf01579f71c60a6845978593 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 5 Oct 2012 06:42:26 -0700 Subject: [PATCH] Put temporary storage in the device instead of on the stack --- Alc/mixer.c | 5 ++--- OpenAL32/Include/alMain.h | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Alc/mixer.c b/Alc/mixer.c index 5b180f1e..c46fa423 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -157,9 +157,8 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) for(chan = 0;chan < NumChannels;chan++) { - /* +1 for the predictive sample. */ - ALIGN(16) ALfloat SrcData[BUFFERSIZE+1]; - ALIGN(16) ALfloat ResampledData[BUFFERSIZE+1]; + ALfloat *SrcData = Device->SampleData1; + ALfloat *ResampledData = Device->SampleData2; ALuint SrcDataSize = 0; if(Source->SourceType == AL_STATIC) diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 1449054f..8b0850de 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -587,7 +587,7 @@ enum DeviceType { /* Size for temporary storage of buffer data, in ALfloats. Larger values need - * more stack, while smaller values may need more iterations. The value needs + * more memory, while smaller values may need more iterations. The value needs * to be a sensible size, however, as it constrains the max stepping value used * for mixing, as well as the maximum number of samples per mixing iteration. * @@ -654,6 +654,10 @@ struct ALCdevice_struct ALfloat SpeakerAngle[MaxChannels]; ALuint NumChan; + /* Temp storage used for mixing. +1 for the predictive sample. */ + ALIGN(16) ALfloat SampleData1[BUFFERSIZE+1]; + ALIGN(16) ALfloat SampleData2[BUFFERSIZE+1]; + // Dry path buffer mix ALIGN(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE]; -- 2.11.4.GIT