From 0762e5c28987ee511544b324b9487907f52736d1 Mon Sep 17 00:00:00 2001 From: borine <32966433+borine@users.noreply.github.com> Date: Thu, 7 Mar 2019 08:26:04 +0000 Subject: [PATCH] decoder/plugins/PcmDecoderPlugin: guard alsa specific code with pre-processor macro test --- src/decoder/plugins/PcmDecoderPlugin.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx index 8cb24fad0..5ceea9f1a 100644 --- a/src/decoder/plugins/PcmDecoderPlugin.cxx +++ b/src/decoder/plugins/PcmDecoderPlugin.cxx @@ -28,9 +28,12 @@ #include "util/StaticFifoBuffer.hxx" #include "util/NumberParser.hxx" #include "util/MimeType.hxx" -#include "AudioParser.hxx" #include "Log.hxx" +#ifdef ENABLE_ALSA +#include "AudioParser.hxx" +#endif + #include #include @@ -135,6 +138,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is) audio_format.channels = value; } +#ifdef ENABLE_ALSA if (GetMimeTypeBase(mime) == "audio/x-mpd-alsa-pcm") { i = mime_parameters.find("format"); if (i != mime_parameters.end()) { @@ -148,6 +152,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is) } } } +#endif } if (audio_format.sample_rate == 0) { @@ -236,8 +241,10 @@ static const char *const pcm_mime_types[] = { /* same as above, but with reverse byte order */ "audio/x-mpd-cdda-pcm-reverse", +#ifdef ENABLE_ALSA /* for streams obtained by the alsa input plugin */ "audio/x-mpd-alsa-pcm", +#endif nullptr };