aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 1f6d75d9d..b7b0a1151 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -38,6 +38,9 @@ static const char default_device[] = "default";
#include <alsa/asoundlib.h>
+/* #define MPD_SND_PCM_NONBLOCK SND_PCM_NONBLOCK */
+#define MPD_SND_PCM_NONBLOCK 0
+
/*
* This macro will evaluate both statements, but only returns the result
* of the second statement to the reader. Thus it'll stringify the
@@ -172,14 +175,16 @@ static int alsa_openDevice(AudioOutput * audioOutput)
ad->device, audioFormat->bits);
err = E(snd_pcm_open, &ad->pcmHandle, ad->device,
- SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
+ SND_PCM_STREAM_PLAYBACK, MPD_SND_PCM_NONBLOCK);
if (err < 0) {
ad->pcmHandle = NULL;
goto error;
}
+#if MPD_SND_PCM_NONBLOCK == SND_PCM_NONBLOCK
if ((err = E(snd_pcm_nonblock, ad->pcmHandle, 0)) < 0)
goto error;
+#endif /* MPD_SND_PCM_NONBLOCK == SND_PCM_NONBLOCK */
period_time_ro = period_time = ad->period_time;
configure_hw: