From 4b1a4fdbb9e4c2c572552fba5754bad82c2417b4 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 15 May 2024 07:12:24 +1000 Subject: [PATCH] FullscreenUI: Fix minimal output latency toggle --- pcsx2/ImGui/FullscreenUI.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index c6a41105fc..a4ec6891c3 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -3980,19 +3980,7 @@ void FullscreenUI::DrawAudioSettingsPage() DrawIntRangeSetting(bsi, FSUI_CSTR("Buffer Size"), FSUI_CSTR("Determines the amount of audio buffered before being pulled by the host API."), "SPU2/Output", "BufferMS", AudioStreamParameters::DEFAULT_BUFFER_MS, 10, 500, FSUI_CSTR("%d ms")); - - const u32 output_latency = - GetEffectiveUIntSetting(bsi, "SPU2/Output", "OutputLatencyMS", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS); - bool output_latency_minimal = (output_latency == 0); - if (ToggleButton(FSUI_CSTR("Minimal Output Latency"), - FSUI_CSTR("When enabled, the minimum supported output latency will be used for the host API."), - &output_latency_minimal)) - { - bsi->SetUIntValue("SPU2/Output", "OutputLatencyMS", - output_latency_minimal ? 0 : AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS); - SetSettingsChanged(bsi); - } - if (!output_latency_minimal) + if (!GetEffectiveBoolSetting(bsi, "Audio", "OutputLatencyMinimal", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MINIMAL)) { DrawIntRangeSetting( bsi, FSUI_CSTR("Output Latency"), @@ -4000,6 +3988,9 @@ void FullscreenUI::DrawAudioSettingsPage() "played through speakers."), "SPU2/Output", "OutputLatencyMS", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MS, 1, 500, FSUI_CSTR("%d ms")); } + DrawToggleSetting(bsi, FSUI_CSTR("Minimal Output Latency"), + FSUI_CSTR("When enabled, the minimum supported output latency will be used for the host API."), + "SPU2/Output", "OutputLatencyMinimal", AudioStreamParameters::DEFAULT_OUTPUT_LATENCY_MINIMAL); EndMenuButtons(); }