From 452e1c1a6f4a1a099f7759acbe8b1b3fdf9d5a8c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Jan 2020 19:15:28 +0100 Subject: [PATCH] pcm/Convert: throw if !ENABLE_DSD --- src/pcm/Convert.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pcm/Convert.cxx b/src/pcm/Convert.cxx index 1cfd186d8..d464d210e 100644 --- a/src/pcm/Convert.cxx +++ b/src/pcm/Convert.cxx @@ -39,8 +39,13 @@ PcmConvert::PcmConvert(const AudioFormat _src_format, assert(dest_format.IsValid()); AudioFormat format = _src_format; - if (format.format == SampleFormat::DSD) + if (format.format == SampleFormat::DSD) { +#ifdef ENABLE_DSD format.format = SampleFormat::FLOAT; +#else + throw std::runtime_error("DSD support is disabled"); +#endif + } enable_resampler = format.sample_rate != dest_format.sample_rate; if (enable_resampler) {