From 846cdafbed4a3e84f42a35cd0bfd38a2bf5e205d Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Sun, 18 Jun 2023 01:47:43 +0900 Subject: [PATCH] UI: Fix changed state of audio settings When changing audio channels, sample rate, or audio buffering settings multiple times by hitting `Apply` button, the internal `changed` state got corrupted. To avoid this, set the changed state when changed something, but do not clear the changed state. --- UI/window-basic-settings.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 09304768c..ccea353ee 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -4643,17 +4643,15 @@ void OBSBasicSettings::AudioChangedRestart() if (currentChannelIndex != channelIndex || currentSampleRateIndex != sampleRateIndex || currentLLAudioBufVal != llBufferingEnabled) { - audioChanged = true; ui->audioMsg->setText( QTStr("Basic.Settings.ProgramRestart")); - sender()->setProperty("changed", QVariant(true)); - EnableApplyButton(true); } else { - audioChanged = false; ui->audioMsg->setText(""); - sender()->setProperty("changed", QVariant(false)); - EnableApplyButton(false); } + + audioChanged = true; + sender()->setProperty("changed", QVariant(true)); + EnableApplyButton(true); } }