diff options
author | Chris Robinson <[email protected]> | 2019-07-04 17:00:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-07-04 17:00:01 -0700 |
commit | 474073955bd76f868d97a4fb587ec4c37b29f7f7 (patch) | |
tree | 64a9af615f22bf7258083e5c63cb62cc0a9a5284 | |
parent | 3fe5ef272f436db82beeeee3ad123029e4d219b6 (diff) |
Pass a span to ApplyStablizer
-rw-r--r-- | Alc/alu.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index b12559d7..f5c3b842 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -1429,16 +1429,16 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo) } -void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const ALuint lidx, - const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo, const ALuint NumChannels) +void ApplyStablizer(FrontStablizer *Stablizer, const al::span<FloatBufferLine> Buffer, + const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo) { ASSUME(SamplesToDo > 0); - ASSUME(NumChannels > 0); /* Apply a delay to all channels, except the front-left and front-right, so * they maintain correct timing. */ - for(ALuint i{0};i < NumChannels;i++) + const size_t NumChannels{Buffer.size()}; + for(size_t i{0u};i < NumChannels;i++) { if(i == lidx || i == ridx) continue; @@ -1684,8 +1684,7 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples) const int cidx{GetChannelIdxByName(device->RealOut, FrontCenter)}; assert(lidx >= 0 && ridx >= 0 && cidx >= 0); - ApplyStablizer(device->Stablizer.get(), RealOut.data(), lidx, ridx, cidx, SamplesToDo, - static_cast<ALuint>(RealOut.size())); + ApplyStablizer(device->Stablizer.get(), RealOut, lidx, ridx, cidx, SamplesToDo); } /* Apply compression, limiting sample amplitude if needed or desired. */ |