From 3120958a17f1fcbfc90d0c2ee2ede9e31c4cf09d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Sep 2014 10:52:46 +0200 Subject: pcm: --disable-dsd also disables the dsd2pcm library --- src/pcm/PcmConvert.cxx | 4 ++++ src/pcm/PcmConvert.hxx | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/pcm') diff --git a/src/pcm/PcmConvert.cxx b/src/pcm/PcmConvert.cxx index bbc5fc638..2b7cfe7f0 100644 --- a/src/pcm/PcmConvert.cxx +++ b/src/pcm/PcmConvert.cxx @@ -109,7 +109,9 @@ PcmConvert::Close() if (enable_resampler) resampler.Close(); +#ifdef ENABLE_DSD dsd.Reset(); +#endif #ifndef NDEBUG src_format.Clear(); @@ -120,6 +122,7 @@ PcmConvert::Close() ConstBuffer PcmConvert::Convert(ConstBuffer buffer, Error &error) { +#ifdef ENABLE_DSD if (src_format.format == SampleFormat::DSD) { auto s = ConstBuffer::FromVoid(buffer); auto d = dsd.ToFloat(src_format.channels, s); @@ -131,6 +134,7 @@ PcmConvert::Convert(ConstBuffer buffer, Error &error) buffer = d.ToVoid(); } +#endif if (enable_resampler) { buffer = resampler.Resample(buffer, error); diff --git a/src/pcm/PcmConvert.hxx b/src/pcm/PcmConvert.hxx index 9d63e07c9..26ab02923 100644 --- a/src/pcm/PcmConvert.hxx +++ b/src/pcm/PcmConvert.hxx @@ -20,13 +20,17 @@ #ifndef PCM_CONVERT_HXX #define PCM_CONVERT_HXX -#include "PcmDsd.hxx" +#include "check.h" #include "PcmBuffer.hxx" #include "FormatConverter.hxx" #include "ChannelsConverter.hxx" #include "GlueResampler.hxx" #include "AudioFormat.hxx" +#ifdef ENABLE_DSD +#include "PcmDsd.hxx" +#endif + #include template struct ConstBuffer; @@ -39,7 +43,9 @@ class Domain; * conversions. */ class PcmConvert { +#ifdef ENABLE_DSD PcmDsd dsd; +#endif GluePcmResampler resampler; PcmFormatConverter format_converter; -- cgit v1.2.3