WASAPI: Disable auto-SRC when requesting default sample rate.

This commit is contained in:
David Reid
2019-09-18 17:47:46 +10:00
parent 1d04f03a85
commit 81a65ce67f
+6 -1
View File
@@ -7953,8 +7953,13 @@ ma_result ma_device_init_internal__wasapi(ma_context* pContext, ma_device_type d
goto done; goto done;
} }
/* Override the native sample rate with the one requested by the caller. We'll use WASAPI to perform the sample rate conversion. */ /*
Override the native sample rate with the one requested by the caller, but only if we're not using the default sample rate. We'll use
WASAPI to perform the sample rate conversion.
*/
if (!pData->usingDefaultSampleRate) {
wf.Format.nSamplesPerSec = pData->sampleRateIn; wf.Format.nSamplesPerSec = pData->sampleRateIn;
}
pData->formatOut = ma_format_from_WAVEFORMATEX((WAVEFORMATEX*)&wf); pData->formatOut = ma_format_from_WAVEFORMATEX((WAVEFORMATEX*)&wf);
pData->channelsOut = wf.Format.nChannels; pData->channelsOut = wf.Format.nChannels;