Visualization: Correct possible race condition
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run

It's safer to ignore an out of range latency value before it's actually
assigned, rather than letting it slip through before gating it with the
control variable. So, assign the ignore latency state before assigning
latency itself, since neither side is synchronization locked, because it
used to just be one variable, which was fairly safe to leave unsynced,
but now it's two.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-07-01 04:55:24 -07:00
parent 869bdd9a9b
commit d32f77d02f

View file

@ -101,8 +101,8 @@ static VisualizationController *_sharedController = nil;
}
- (void)postLatency:(double)latency {
self->latency = latency;
ignoreLatency = (latency >= 45.0) || (latency < 0.0);
self->latency = latency;
}
- (double)readSampleRate {