aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-09 18:34:00 -0800
committerChris Robinson <[email protected]>2019-03-09 18:34:00 -0800
commit87479b4b3207a0600586c919c03b5cee7af5154e (patch)
treebf951619b457bcd4333a4b08c9e6558431ce99b9 /OpenAL32
parentef0f3351321a7488e60faa838a4628cfecf230b8 (diff)
Play dummy samples and force a fade out on stopping voices
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alu.h3
-rw-r--r--OpenAL32/alSource.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index fbf21c47..90b6873a 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -252,7 +252,8 @@ struct ALvoice {
ALuint Offset; /* Number of output samples mixed since starting. */
- alignas(16) std::array<std::array<ALfloat,MAX_RESAMPLE_PADDING>,MAX_INPUT_CHANNELS> PrevSamples;
+ using ResamplePaddingArray = std::array<ALfloat,MAX_RESAMPLE_PADDING*2>;
+ alignas(16) std::array<ResamplePaddingArray,MAX_INPUT_CHANNELS> PrevSamples;
InterpState ResampleState;
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index feab5213..9749e47c 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -2855,7 +2855,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
/* Clear previous samples. */
std::for_each(voice->PrevSamples.begin(), voice->PrevSamples.begin()+voice->NumChannels,
- [](std::array<ALfloat,MAX_RESAMPLE_PADDING> &samples) -> void
+ [](std::array<ALfloat,MAX_RESAMPLE_PADDING*2> &samples) -> void
{ std::fill(std::begin(samples), std::end(samples), 0.0f); });
/* Clear the stepping value so the mixer knows not to mix this until