Add a config option to prevent WASAPI from using a resampler

This commit is contained in:
Chris Robinson 2022-11-12 23:41:11 -08:00
parent 936f7d8401
commit 2f2d3c33aa
2 changed files with 13 additions and 1 deletions

View File

@ -57,6 +57,7 @@
#include <vector>
#include "albit.h"
#include "alc/alconfig.h"
#include "alnumeric.h"
#include "comptr.h"
#include "core/converter.h"
@ -1054,7 +1055,10 @@ HRESULT WasapiPlayback::resetProxy()
CoTaskMemFree(wfx);
wfx = nullptr;
mDevice->Frequency = minu(mDevice->Frequency, mFormat.Format.nSamplesPerSec);
if(!GetConfigValueBool(mDevice->DeviceName.c_str(), "wasapi", "allow-resampler", true))
mDevice->Frequency = mFormat.Format.nSamplesPerSec;
else
mDevice->Frequency = minu(mDevice->Frequency, mFormat.Format.nSamplesPerSec);
const uint32_t chancount{OutputType.Format.nChannels};
const DWORD chanmask{OutputType.dwChannelMask};

View File

@ -567,6 +567,14 @@
##
[wasapi]
## allow-resampler:
# Specifies whether to allow an extra resampler pass on the output. Enabling
# this will allow the playback device to be set to a different sample rate
# than the actual output can accept, causing the backend to apply its own
# resampling pass after OpenAL Soft mixes the sources and processes effects
# for output.
#allow-resampler = true
##
## DirectSound backend stuff
##