src/output: Set fallback setting for DSD

This commit is contained in:
Shen-Ta Hsieh 2020-12-02 08:05:41 +08:00 committed by Max Kellermann
parent 010f65a1d6
commit 6f77af20d0

View File

@ -113,6 +113,13 @@ inline void SetFormat(WAVEFORMATEXTENSIBLE &device_format,
}
}
#ifdef ENABLE_DSD
void SetDSDFallback(AudioFormat &audio_format) noexcept {
audio_format.format = SampleFormat::FLOAT;
audio_format.sample_rate = 384000;
}
#endif
inline constexpr const unsigned int kErrorId = -1;
} // namespace
@ -360,6 +367,12 @@ void WasapiOutput::DoOpen(AudioFormat &audio_format) {
audio_format.channels = 8;
}
#ifdef ENABLE_DSD
if (audio_format.format == SampleFormat::DSD) {
SetDSDFallback(audio_format);
}
#endif
if (Exclusive()) {
FindExclusiveFormatSupported(audio_format);
} else {