diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java index 671d919..688ce91 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java @@ -39,15 +39,15 @@ public class VisualizerCore implements Disposable { } public void setMM(MusicManager mm) { + lock.lock(); if (audioPCM == null || audioPCM.length != mm.getReadWindowSize()) { calc = false; - lock.lock(); fft = new FloatFFT_1D(mm.getReadWindowSize()); audioPCM = new float[mm.getReadWindowSize()]; - lock.unlock(); } this.mm = mm; calc = true; + lock.unlock(); } public void render(Batch batch, float parentAlpha) {