aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-09-05 20:48:56 -0700
committerChris Robinson <[email protected]>2020-09-05 20:48:56 -0700
commitc52bf8c401aaf78bbcfa99b33fdaf4838999d547 (patch)
tree453bccbc16da43e7ec5403b57feab52e82e12faa /alc/alc.cpp
parent9975aeb37f0bcb9a35b1cba7a755abc4774883d0 (diff)
Rework effect slot buffer setting
Rather than creating an effect-specific buffer that gets passed along as a property, the buffer is set the effect state when the effect state is created, the device is updated, or the buffer is changed. The buffer can only be set while the effect slot isn't playing, so it won't be changed or updated while the mixer is processing the effect state.
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r--alc/alc.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index a8ec407f..8a89e8c2 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -2102,10 +2102,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
state->mOutTarget = device->Dry.Buffer;
state->deviceUpdate(device);
if(ALbuffer *buffer{slot->Buffer})
- {
- slot->Effect.Buffer = nullptr;
- slot->Effect.Buffer.reset(state->createBuffer(device, buffer->mBuffer));
- }
+ state->setBuffer(device, &buffer->mBuffer);
slot->updateProps(context);
}
@@ -2128,10 +2125,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
state->mOutTarget = device->Dry.Buffer;
state->deviceUpdate(device);
if(ALbuffer *buffer{slot->Buffer})
- {
- slot->Effect.Buffer = nullptr;
- slot->Effect.Buffer.reset(state->createBuffer(device, buffer->mBuffer));
- }
+ state->setBuffer(device, &buffer->mBuffer);
slot->updateProps(context);
}
}