diff options
author | Chris Robinson <[email protected]> | 2022-11-12 19:25:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-11-12 19:25:08 -0800 |
commit | 50ba074fe1b0d0ddc4604a0a6bb723382d9e60ad (patch) | |
tree | a2e66361639bf69b6ec32c23195ef8e1ba60a7c1 /core/converter.cpp | |
parent | 68e04624b1f94d9bf8f9ebce5d90e64ab143efea (diff) |
Add a method for the input sample delay for the SampleConverter
Diffstat (limited to 'core/converter.cpp')
-rw-r--r-- | core/converter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/converter.cpp b/core/converter.cpp index 6a06b464..f4c36c87 100644 --- a/core/converter.cpp +++ b/core/converter.cpp @@ -167,8 +167,13 @@ SampleConverterPtr CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, converter->mSrcTypeSize = BytesFromDevFmt(srcType); converter->mDstTypeSize = BytesFromDevFmt(dstType); - converter->mSrcPrepCount = 0; + converter->mSrcPrepCount = MaxResamplerEdge; converter->mFracOffset = 0; + for(auto &chan : converter->mChan) + { + const al::span<float> buffer{chan.PrevSamples}; + std::fill(buffer.begin(), buffer.end(), 0.0f); + } /* Have to set the mixer FPU mode since that's what the resampler code expects. */ FPUCtl mixer_mode{}; |