diff --git a/soundlib/Snd_fx.cpp b/soundlib/Snd_fx.cpp index 8fa65eed36..c7482326ff 100644 --- a/soundlib/Snd_fx.cpp +++ b/soundlib/Snd_fx.cpp @@ -1428,6 +1428,8 @@ std::vector CSoundFile::GetLength(enmGetLengthResetMode adjustMod { m_MixPlugins[plug].fDryRatio = dryWetRatio; } + + UpdatePluginPositions(); #endif // NO_PLUGINS } else if(adjustMode != eAdjustOnSuccess) { diff --git a/soundlib/Sndfile.cpp b/soundlib/Sndfile.cpp index cd9b7addda..9057670fb8 100644 --- a/soundlib/Sndfile.cpp +++ b/soundlib/Sndfile.cpp @@ -1019,6 +1019,25 @@ void CSoundFile::ResumePlugins() } +void CSoundFile::UpdatePluginPositions() +{ +#ifndef NO_PLUGINS + float out = 0.0f; + for(auto &plugin : m_MixPlugins) + { + IMixPlugin *pPlugin = plugin.pMixPlugin; + if(pPlugin != nullptr && !pPlugin->IsResumed()) + { + pPlugin->PositionChanged(); + pPlugin->Resume(); + pPlugin->Process(&out, &out, 0); + pPlugin->Suspend(); + } + } +#endif // NO_PLUGINS +} + + void CSoundFile::StopAllVsti() { #ifndef NO_PLUGINS diff --git a/soundlib/Sndfile.h b/soundlib/Sndfile.h index 86a7d971ae..eede9546ff 100644 --- a/soundlib/Sndfile.h +++ b/soundlib/Sndfile.h @@ -966,6 +966,7 @@ class CSoundFile // Real-time sound functions void SuspendPlugins(); void ResumePlugins(); + void UpdatePluginPositions(); void StopAllVsti(); void RecalculateGainForAllPlugs(); void ResetChannels();