Skip to content

Commit dc05b69

Browse files
committed
Remove unnecessary IR state checks from _ResetModelAndIR
Reverted to match upstream behavior - the IR state checks were speculative and not required for the embedding feature.
1 parent 1233630 commit dc05b69

1 file changed

Lines changed: 8 additions & 27 deletions

File tree

NeuralAmpModeler/NeuralAmpModeler.cpp

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -642,39 +642,20 @@ void NeuralAmpModeler::_ResetModelAndIR(const double sampleRate, const int maxBl
642642
// IR
643643
if (mStagedIR != nullptr)
644644
{
645-
// Layer 8: Check IR state before resampling
646-
// Don't try to resample an IR that failed to load properly
647-
if (mStagedIR->GetWavState() == dsp::wav::LoadReturnCode::SUCCESS)
645+
const double irSampleRate = mStagedIR->GetSampleRate();
646+
if (irSampleRate != sampleRate)
648647
{
649-
const double irSampleRate = mStagedIR->GetSampleRate();
650-
if (irSampleRate != sampleRate)
651-
{
652-
const auto irData = mStagedIR->GetData();
653-
mStagedIR = std::make_unique<dsp::ImpulseResponse>(irData, sampleRate);
654-
}
655-
}
656-
else
657-
{
658-
// IR is in error state - discard it
659-
mStagedIR = nullptr;
648+
const auto irData = mStagedIR->GetData();
649+
mStagedIR = std::make_unique<dsp::ImpulseResponse>(irData, sampleRate);
660650
}
661651
}
662652
else if (mIR != nullptr)
663653
{
664-
// Layer 8: Check IR state before resampling
665-
if (mIR->GetWavState() == dsp::wav::LoadReturnCode::SUCCESS)
666-
{
667-
const double irSampleRate = mIR->GetSampleRate();
668-
if (irSampleRate != sampleRate)
669-
{
670-
const auto irData = mIR->GetData();
671-
mStagedIR = std::make_unique<dsp::ImpulseResponse>(irData, sampleRate);
672-
}
673-
}
674-
else
654+
const double irSampleRate = mIR->GetSampleRate();
655+
if (irSampleRate != sampleRate)
675656
{
676-
// IR is in error state - don't try to resample it
677-
// Keep existing mIR but don't create staged version
657+
const auto irData = mIR->GetData();
658+
mStagedIR = std::make_unique<dsp::ImpulseResponse>(irData, sampleRate);
678659
}
679660
}
680661
}

0 commit comments

Comments
 (0)