aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer/mixer_neon.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-12 04:45:25 -0700
committerChris Robinson <[email protected]>2020-05-12 04:45:25 -0700
commit2f8f829772305c47a495f7197a44a836b1e3f7cb (patch)
treed8c658d5304259d5783ff6e424eb9dd7e0071715 /alc/mixer/mixer_neon.cpp
parent3ce8a9914cddd6c050b2be65cd7f36b31010a4cd (diff)
Properly count the last number of samples to mix
Diffstat (limited to 'alc/mixer/mixer_neon.cpp')
-rw-r--r--alc/mixer/mixer_neon.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp
index 2cf7e2e8..9d21b1c5 100644
--- a/alc/mixer/mixer_neon.cpp
+++ b/alc/mixer/mixer_neon.cpp
@@ -219,6 +219,7 @@ void Mix_<NEONTag>(const al::span<const float> InSamples, const al::span<FloatBu
const float delta{(Counter > 0) ? 1.0f / static_cast<float>(Counter) : 0.0f};
const auto min_len = minz(Counter, InSamples.size());
const auto aligned_len = minz((min_len+3) & ~size_t{3}, InSamples.size()) - min_len;
+
for(FloatBufferLine &output : OutBuffer)
{
float *RESTRICT dst{al::assume_aligned<16>(output.data()+OutPos)};
@@ -288,7 +289,7 @@ void Mix_<NEONTag>(const al::span<const float> InSamples, const al::span<FloatBu
pos += 4;
} while(--todo);
}
- for(size_t leftover{InSamples.size()&3};leftover;++pos,--leftover)
+ for(size_t leftover{(InSamples.size()-pos)&3};leftover;++pos,--leftover)
dst[pos] += InSamples[pos] * gain;
}
}