pcm/Convert: throw if !ENABLE_DSD

This commit is contained in:
Max Kellermann 2020-01-17 19:15:28 +01:00
parent 8db86e2820
commit 452e1c1a6f
1 changed files with 6 additions and 1 deletions

View File

@ -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) {