Skip to content

Commit

Permalink
Don't SetLatency() when it won't change the latency. (#516)
Browse files Browse the repository at this point in the history
* Only _UpdateLatency() during OnReset() when sample rate changes

* SetLatency() only when setting with a different value
  • Loading branch information
sdatkinson authored Oct 30, 2024
1 parent 70f4296 commit 6466123
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion NeuralAmpModeler/NeuralAmpModeler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,12 @@ void NeuralAmpModeler::_UpdateLatency()
latency += mModel->GetLatency();
}
// Other things that add latency here...
SetLatency(latency);

// Feels weird to have to do this.
if (GetLatency() != latency)
{
SetLatency(latency);
}
}

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

0 comments on commit 6466123

Please sign in to comment.