Skip to content

Commit 6466123

Browse files
authored
Don't SetLatency() when it won't change the latency. (#516)
* Only _UpdateLatency() during OnReset() when sample rate changes * SetLatency() only when setting with a different value
1 parent 70f4296 commit 6466123

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

NeuralAmpModeler/NeuralAmpModeler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,12 @@ void NeuralAmpModeler::_UpdateLatency()
890890
latency += mModel->GetLatency();
891891
}
892892
// Other things that add latency here...
893-
SetLatency(latency);
893+
894+
// Feels weird to have to do this.
895+
if (GetLatency() != latency)
896+
{
897+
SetLatency(latency);
898+
}
894899
}
895900

896901
void NeuralAmpModeler::_UpdateMeters(sample** inputPointer, sample** outputPointer, const size_t nFrames,

0 commit comments

Comments
 (0)