diff options
author | Chris Robinson <[email protected]> | 2020-05-12 04:46:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-05-12 04:46:15 -0700 |
commit | ad95cb6312dc2a3ac458f79af4f50104bcb01708 (patch) | |
tree | f98107b931abf6955d747eb77710c33cc4bc0092 /alc/alu.cpp | |
parent | 2f8f829772305c47a495f7197a44a836b1e3f7cb (diff) |
Clear the whole buffer
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r-- | alc/alu.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index 40fb12f0..b2e287a9 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1728,7 +1728,7 @@ void ProcessContexts(ALCdevice *device, const ALuint SamplesToDo) for(ALeffectslot *slot : auxslots) { for(auto &buffer : slot->MixBuffer) - std::fill_n(buffer.begin(), SamplesToDo, 0.0f); + buffer.fill(0.0f); } /* Process voices that have a playing source. */ @@ -2018,9 +2018,7 @@ void aluMixData(ALCdevice *device, void *OutBuffer, const ALuint NumSamples, /* Clear main mixing buffers. */ std::for_each(device->MixBuffer.begin(), device->MixBuffer.end(), - [SamplesToDo](FloatBufferLine &buffer) -> void - { std::fill_n(buffer.begin(), SamplesToDo, 0.0f); } - ); + [](FloatBufferLine &buffer) -> void { buffer.fill(0.0f); }); /* Increment the mix count at the start (lsb should now be 1). */ IncrementRef(device->MixCount); |