From 27ac637a66df64c4135b77ee123d1a02076b08a0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 16 Apr 2020 17:29:32 -0700 Subject: Remove another unnecessary return value --- alc/alc.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'alc/alc.cpp') diff --git a/alc/alc.cpp b/alc/alc.cpp index 021097a3..e8c23476 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -2214,21 +2214,17 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) TRACE("Fixed device latency: %" PRId64 "ns\n", int64_t{device->FixedLatency.count()}); - /* Need to delay returning failure until the Send arrays have been cleared. */ - bool update_failed{false}; FPUCtl mixer_mode{}; for(ALCcontext *context : *device->mContexts.load()) { - if(context->mDefaultSlot && !update_failed) + if(ALeffectslot *slot{context->mDefaultSlot.get()}) { - ALeffectslot *slot{context->mDefaultSlot.get()}; aluInitEffectPanning(slot, device); EffectState *state{slot->Effect.State}; state->mOutTarget = device->Dry.Buffer; - update_failed = !state->deviceUpdate(device); - if(!update_failed) - UpdateEffectSlotProps(slot, context); + state->deviceUpdate(device); + UpdateEffectSlotProps(slot, context); } std::unique_lock proplock{context->mPropLock}; @@ -2237,7 +2233,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) std::fill_n(curarray->end(), curarray->size(), nullptr); for(auto &sublist : context->mEffectSlotList) { - if(update_failed) break; uint64_t usemask{~sublist.FreeMask}; while(usemask) { @@ -2249,8 +2244,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) EffectState *state{slot->Effect.State}; state->mOutTarget = device->Dry.Buffer; - update_failed = !state->deviceUpdate(device); - if(update_failed) break; + state->deviceUpdate(device); UpdateEffectSlotProps(slot, context); } } @@ -2380,8 +2374,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) UpdateAllSourceProps(context); } mixer_mode.leave(); - if(update_failed) - return ALC_INVALID_DEVICE; if(!device->Flags.get()) { -- cgit v1.2.3