diff options
-rw-r--r-- | Alc/alc.cpp | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 2 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 1ae92779..441add06 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -36,6 +36,7 @@ #include <string> #include <numeric> #include <algorithm> +#include <functional> #include "alMain.h" #include "alcontext.h" @@ -114,6 +115,8 @@ namespace { +using namespace std::placeholders; + /************************************************ * Backends ************************************************/ @@ -2648,6 +2651,11 @@ void AllocateVoices(ALCcontext *context, ALsizei num_voices, ALsizei old_sends) voice->mResampleState = old_voice->mResampleState; + voice->mAmbiScales = old_voice->mAmbiScales; + voice->mAmbiSplitter = old_voice->mAmbiSplitter; + std::for_each(voice->mAmbiSplitter.begin(),voice->mAmbiSplitter.end(), + std::bind(std::mem_fn(&BandSplitter::clear), _1)); + voice->mDirect = old_voice->mDirect; std::copy_n(old_voice->mSend.begin(), s_count, voice->mSend.begin()); diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 9c33779d..3856bc72 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -255,7 +255,7 @@ struct ALvoice { InterpState mResampleState; std::array<ALfloat,MAX_INPUT_CHANNELS> mAmbiScales; - BandSplitter mAmbiSplitter[MAX_INPUT_CHANNELS]; + std::array<BandSplitter,MAX_INPUT_CHANNELS> mAmbiSplitter; struct { int FilterType; diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index 17fbcb03..fcdce9c4 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -2895,7 +2895,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) } voice->mAmbiSplitter[0].init(400.0f / static_cast<ALfloat>(device->Frequency)); - std::fill_n(std::begin(voice->mAmbiSplitter)+1, voice->mNumChannels-1, + std::fill_n(voice->mAmbiSplitter.begin()+1, voice->mNumChannels-1, voice->mAmbiSplitter[0]); voice->mFlags |= VOICE_IS_AMBISONIC; } |