From 40353375aa0e812ed14900552b007dfab2f21a1f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 17 Oct 2008 11:43:43 +0200 Subject: Replace configure test for PulseAudio version by cpp test Version 0.9.6 has PA_PROTOCOL_VERSION 10, version 0.9.7 has 11. This simplifies configure and limits the knowledge about PA versions to the audio output plug-in. This time, the patch includes configure.ac, too. --- configure.ac | 11 +---------- src/audio_out/audio_pulse_out.c | 6 ++++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 4936e6638..552a696a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1081,17 +1081,8 @@ AC_ARG_WITH([pulseaudio], if test "x$with_pulseaudio" != "xno"; then PKG_CHECK_MODULES([PULSEAUDIO], [libpulse], [have_pulseaudio="yes"], [have_pulseaudio="no"]) - if test x"$have_pulseaudio" = xyes; then - AC_MSG_CHECKING([for pulseaudio >= 0.9.7]) - PKG_CHECK_EXISTS([libpulse >= 0.9.7], - [have_pulseaudio_0_9_7="yes"], - [have_pulseaudio_0_9_7="no"]) - AC_MSG_RESULT([$have_pulseaudio_0_9_7]) - if test x"$have_pulseaudio_0_9_7" = xyes; then - AC_DEFINE([HAVE_PULSEAUDIO_0_9_7], 1, [define this if you have pulseaudio >= 0.9.7]) - fi - fi fi + AM_CONDITIONAL(HAVE_PULSEAUDIO, [test "x$have_pulseaudio" = x"yes"]) AC_SUBST([PULSEAUDIO_CFLAGS]) AC_SUBST([PULSEAUDIO_LIBS]) diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c index dfae98c31..4b66fbaed 100644 --- a/src/audio_out/audio_pulse_out.c +++ b/src/audio_out/audio_pulse_out.c @@ -218,7 +218,8 @@ static void __xine_pa_sink_info_callback(pa_context *c, const pa_sink_input_info this->cvolume = info->volume; this->swvolume = pa_cvolume_avg(&info->volume); -#ifdef HAVE_PULSEAUDIO_0_9_7 +#if PA_PROTOCOL_VERSION >= 11 + /* PulseAudio 0.9.7 and newer */ this->muted = info->mute; #else this->muted = pa_cvolume_is_muted (&this->cvolume); @@ -665,7 +666,8 @@ static int ao_pulse_set_property (ao_driver_t *this_gen, int property, int value this->muted = value; -#ifdef HAVE_PULSEAUDIO_0_9_7 +#if PA_PROTOCOL_VERSION >= 11 + /* PulseAudio 0.9.7 and newer */ o = pa_context_set_sink_input_mute(this->context, pa_stream_get_index(this->stream), value, __xine_pa_context_success_callback, this); #else -- cgit v1.2.3