diff options
author | Shen-Ta Hsieh <ibmibmibm.tw@gmail.com> | 2020-12-02 08:05:41 +0800 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-03-04 18:50:56 +0100 |
commit | 6f77af20d0653dd747530078d0c5e7f1928f102b (patch) | |
tree | 574ea90045d0496dd3f42b0d3d2694c0294c2575 | |
parent | 010f65a1d60ab76bfe0f3fb41475d8799784f9fe (diff) |
src/output: Set fallback setting for DSD
-rw-r--r-- | src/output/plugins/WasapiOutputPlugin.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output/plugins/WasapiOutputPlugin.cxx b/src/output/plugins/WasapiOutputPlugin.cxx index a9bfae83e..e160c1f38 100644 --- a/src/output/plugins/WasapiOutputPlugin.cxx +++ b/src/output/plugins/WasapiOutputPlugin.cxx @@ -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 { |