aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_neon.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mixer_neon.c')
-rw-r--r--Alc/mixer_neon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
index 6078a40d..0c50140e 100644
--- a/Alc/mixer_neon.c
+++ b/Alc/mixer_neon.c
@@ -107,7 +107,8 @@ void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer
step = Gains[c].Step;
if(step != 0.0f && Counter > 0)
{
- for(;pos < BufferSize && pos < Counter;pos++)
+ ALuint minsize = minu(BufferSize, Counter);
+ for(;pos < minsize;pos++)
{
OutBuffer[c][OutPos+pos] += data[pos]*gain;
gain += step;
@@ -115,8 +116,10 @@ void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer
if(pos == Counter)
gain = Gains[c].Target;
Gains[c].Current = gain;
+
/* Mix until pos is aligned with 4 or the mix is done. */
- for(;pos < BufferSize && (pos&3) != 0;pos++)
+ minsize = minu(BufferSize, (pos+3)&3);
+ for(;pos < minsize;pos++)
OutBuffer[c][OutPos+pos] += data[pos]*gain;
}