From 86096313bead15ecaf911d8ff41e7074009bd98a Mon Sep 17 00:00:00 2001 From: Catchawink Date: Thu, 12 Dec 2019 09:59:47 -0500 Subject: [PATCH] Fixed an issue with recording audio. Prior to this fix, AudioEffectRecordInstance::init() was called before recording_active is set to true in AudioEffectRecord::set_recording_active(). This was setting is_recording to false in AudioEffectRecordInstance, because is_recording updates to the value of recording_active in AudioEffectRecordInstance::_io_thread_process(). To fix this issue, AudioEffectRecordInstance::init() is now called after recording_active is set to true. --- servers/audio/effects/audio_effect_record.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index 83d78daff49..3b6b1de806a 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -192,10 +192,11 @@ void AudioEffectRecord::set_recording_active(bool p_record) { } ensure_thread_stopped(); + recording_active = true; current_instance->init(); + } else { + recording_active = false; } - - recording_active = p_record; } bool AudioEffectRecord::is_recording_active() const {