aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/echo.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-16 17:29:32 -0700
committerChris Robinson <[email protected]>2020-04-16 17:29:32 -0700
commit27ac637a66df64c4135b77ee123d1a02076b08a0 (patch)
treefb91318537aaa071000c1f4b340ed3822c01bc12 /alc/effects/echo.cpp
parentcf4a848fd0c42e85e5ce68e33120386d932e6375 (diff)
Remove another unnecessary return value
Diffstat (limited to 'alc/effects/echo.cpp')
-rw-r--r--alc/effects/echo.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp
index 6368718a..e14dc5cb 100644
--- a/alc/effects/echo.cpp
+++ b/alc/effects/echo.cpp
@@ -57,14 +57,14 @@ struct EchoState final : public EffectState {
alignas(16) float mTempBuffer[2][BUFFERSIZE];
- bool deviceUpdate(const ALCdevice *device) override;
+ void deviceUpdate(const ALCdevice *device) override;
void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override;
void process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut) override;
DEF_NEWDEL(EchoState)
};
-bool EchoState::deviceUpdate(const ALCdevice *Device)
+void EchoState::deviceUpdate(const ALCdevice *Device)
{
const auto frequency = static_cast<float>(Device->Frequency);
@@ -73,10 +73,7 @@ bool EchoState::deviceUpdate(const ALCdevice *Device)
const ALuint maxlen{NextPowerOf2(float2uint(AL_ECHO_MAX_DELAY*frequency + 0.5f) +
float2uint(AL_ECHO_MAX_LRDELAY*frequency + 0.5f))};
if(maxlen != mSampleBuffer.size())
- {
- mSampleBuffer.resize(maxlen);
- mSampleBuffer.shrink_to_fit();
- }
+ al::vector<float,16>(maxlen).swap(mSampleBuffer);
std::fill(mSampleBuffer.begin(), mSampleBuffer.end(), 0.0f);
for(auto &e : mGains)
@@ -84,8 +81,6 @@ bool EchoState::deviceUpdate(const ALCdevice *Device)
std::fill(std::begin(e.Current), std::end(e.Current), 0.0f);
std::fill(std::begin(e.Target), std::end(e.Target), 0.0f);
}
-
- return true;
}
void EchoState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target)