diff options
Diffstat (limited to 'alc/voice.cpp')
-rw-r--r-- | alc/voice.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/alc/voice.cpp b/alc/voice.cpp index 9c6ff6b5..336d8a92 100644 --- a/alc/voice.cpp +++ b/alc/voice.cpp @@ -615,21 +615,11 @@ void Voice::mix(const State vstate, ALCcontext *Context, const uint SamplesToDo) chandata.mPrevSamples.size(), chandata.mPrevSamples.begin()); /* Resample, then apply ambisonic upsampling as needed. */ - const float *ResampledData{Resample(&mResampleState, - &SrcData[MaxResamplerPadding>>1], DataPosFrac, increment, - {Device->ResampledData, DstBufferSize})}; + float *ResampledData{Resample(&mResampleState, &SrcData[MaxResamplerPadding>>1], + DataPosFrac, increment, {Device->ResampledData, DstBufferSize})}; if((mFlags&VoiceIsAmbisonic)) - { - const float hfscale{chandata.mAmbiScale}; - /* Beware the evil const_cast. It's safe since it's pointing to - * either SourceData or ResampledData (both non-const), but the - * resample method takes the source as const float* and may - * return it without copying to output, making it currently - * unavoidable. - */ - const al::span<float> samples{const_cast<float*>(ResampledData), DstBufferSize}; - chandata.mAmbiSplitter.processHfScale(samples, hfscale); - } + chandata.mAmbiSplitter.processHfScale({ResampledData, DstBufferSize}, + chandata.mAmbiScale); /* Now filter and mix to the appropriate outputs. */ float (&FilterBuf)[BufferLineSize] = Device->FilteredData; |