alsa: added #ifdefs around SND_PCM_NO_AUTO_xxx

These macros are not available in older libasound versions (1.0.13
fails, 1.0.16 is ok).  Ignore the configuration if the constants are
not defined.
This commit is contained in:
Max Kellermann 2008-10-14 22:37:27 +02:00
parent 50e038d1ef
commit 30c86d8ae6

View File

@ -86,14 +86,20 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
if ((bp = getBlockParam(param, "period_time")))
ad->period_time = atoi(bp->value);
#ifdef SND_PCM_NO_AUTO_RESAMPLE
if (!getBoolBlockParam(param, "auto_resample", true))
ad->mode |= SND_PCM_NO_AUTO_RESAMPLE;
#endif
#ifdef SND_PCM_NO_AUTO_CHANNELS
if (!getBoolBlockParam(param, "auto_channels", true))
ad->mode |= SND_PCM_NO_AUTO_CHANNELS;
#endif
#ifdef SND_PCM_NO_AUTO_FORMAT
if (!getBoolBlockParam(param, "auto_format", true))
ad->mode |= SND_PCM_NO_AUTO_FORMAT;
#endif
}
static void *alsa_initDriver(mpd_unused struct audio_output *ao,