aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/voice.cpp12
-rw-r--r--core/voice.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/core/voice.cpp b/core/voice.cpp
index 8e42500e..6001fcac 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -514,8 +514,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const uint SamplesToDo
std::transform(Device->mSampleData.end() - mChans.size(), Device->mSampleData.end(),
MixingSamples.begin(), offset_bufferline);
- const uint PostPadding{MaxResamplerEdge +
- (mDecoder ? uint{UhjDecoder::sFilterDelay} : 0u)};
+ const uint PostPadding{MaxResamplerEdge + mDecoderPadding};
uint buffers_done{0u};
uint OutPos{0u};
do {
@@ -854,11 +853,20 @@ void Voice::prepare(DeviceBase *device)
mPrevSamples.resize(num_channels);
if(mFmtChannels == FmtSuperStereo)
+ {
mDecoder = std::make_unique<UhjStereoDecoder>();
+ mDecoderPadding = UhjStereoDecoder::sFilterDelay;
+ }
else if(IsUHJ(mFmtChannels))
+ {
mDecoder = std::make_unique<UhjDecoder>();
+ mDecoderPadding = UhjDecoder::sFilterDelay;
+ }
else
+ {
mDecoder = nullptr;
+ mDecoderPadding = 0;
+ }
/* Clear the stepping value explicitly so the mixer knows not to mix this
* until the update gets applied.
diff --git a/core/voice.h b/core/voice.h
index 3cf10d22..25560cb4 100644
--- a/core/voice.h
+++ b/core/voice.h
@@ -220,6 +220,7 @@ struct Voice {
uint mAmbiOrder;
std::unique_ptr<DecoderBase> mDecoder;
+ uint mDecoderPadding{};
/** Current target parameters used for mixing. */
uint mStep{0};