From 256b88142e1c08b28102a450d41ee02badfa5090 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 31 Oct 2019 08:44:58 +0000 Subject: [PATCH] Made AudioSourcePlayer::setGain() thread-safe --- modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h index 3f5a87d3f4..f1356022c3 100644 --- a/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h +++ b/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h @@ -105,7 +105,8 @@ private: float* outputChans[128]; const float* inputChans[128]; AudioBuffer tempBuffer; - float lastGain = 1.0f, gain = 1.0f; + float lastGain = 1.0f; + std::atomic gain { 1.0f }; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioSourcePlayer) };