From 43678ae0c82818896af4770e4fede393981fa9d7 Mon Sep 17 00:00:00 2001 From: athrxx Date: Thu, 18 Jun 2020 18:11:28 +0200 Subject: [PATCH] SDL: fix --output-rate commandline option The commandline otion was ignored. The code would only query the scummvm.ini setting but not the transient domain (=commandline) setting. --- backends/mixer/sdl/sdl-mixer.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 2a46d877b22..7e59121fe3c 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -146,14 +146,12 @@ static uint32 roundDownPowerOfTwo(uint32 samples) { SDL_AudioSpec SdlMixerManager::getAudioSpec(uint32 outputRate) { SDL_AudioSpec desired; - const char *const appDomain = Common::ConfigManager::kApplicationDomain; - - // There was once a GUI option for this, but it was never used; - // configurability is retained for advanced users only who wish to modify - // their ScummVM config file directly + // There was once a GUI option for this, which was removed. Configurability + // is retained for advanced users only who wish to use the commandline + // option (--output-rate) or modify their ScummVM config file directly. uint32 freq = 0; - if (ConfMan.hasKey("output_rate", appDomain)) - freq = ConfMan.getInt("output_rate", appDomain); + if (ConfMan.hasKey("output_rate")) + freq = ConfMan.getInt("output_rate"); if (freq <= 0) freq = outputRate; @@ -164,8 +162,8 @@ SDL_AudioSpec SdlMixerManager::getAudioSpec(uint32 outputRate) { // characteristics which are not easily measured, so allow advanced users to // tweak their audio buffer size if they are experience excess latency or // drop-outs by setting this value in their ScummVM config file directly - if (ConfMan.hasKey("audio_buffer_size", appDomain)) - samples = ConfMan.getInt("audio_buffer_size", appDomain); + if (ConfMan.hasKey("audio_buffer_size", Common::ConfigManager::kApplicationDomain)) + samples = ConfMan.getInt("audio_buffer_size", Common::ConfigManager::kApplicationDomain); // 256 is an arbitrary minimum; 32768 is the largest power-of-two value // representable with uint16