From ad95cb6312dc2a3ac458f79af4f50104bcb01708 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 12 May 2020 04:46:15 -0700 Subject: Clear the whole buffer --- alc/alu.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'alc') 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); -- cgit v1.2.3