[vlc-commits] commit: PulseAudio: differentiate between libpulse 0.9. 22 and the versions before (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Mon Dec 6 17:22:49 CET 2010


vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Dec  6 00:44:53 2010 +0100| [fc0ddff692490070ab287d1f8533d5b1574731a5] | committer: Jean-Baptiste Kempf 

PulseAudio: differentiate between libpulse 0.9.22 and the versions before

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=fc0ddff692490070ab287d1f8533d5b1574731a5
---

 configure.ac                 |   26 +++++++++++++++++---------
 modules/audio_output/pulse.c |   11 ++++++++---
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index d4f6121..7083bad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3743,18 +3743,26 @@ then
 fi
 
 dnl
-dnl  Pulseaudio module
+dnl  PulseAudio module
 dnl
-AS_IF([test "${no_x}" = "yes"], [
-  AS_IF([test "${enable_pulse}" = "yes"], [
-    AC_MSG_ERROR([Xlib is required for VLC PulseAudio support
-(see http://www.pulseaudio.org/ticket/799 for further reference).])
-  ])
-], [
-  PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
-  VLC_ADD_LIBS([pulse], [${X_LIBS} ${X_PRE_LIBS} -lX11])
+PKG_CHECK_MODULES( PULSE, [libpulse >= 0.9.22], [
+    VLC_ADD_CFLAGS([pulse],[${PULSE_CFLAGS}])
+    VLC_ADD_LIBS([pulse],[${PULSE_LIBS}])
+    VLC_ADD_PLUGIN([pulse])
+  ], [
+    AS_IF([test "${no_x}" = "yes"], [
+        AS_IF([test "${enable_pulse}" = "yes"], [
+            AC_MSG_ERROR([Xlib is required for VLC PulseAudio support
+            (see http://www.pulseaudio.org/ticket/799 for further reference).])
+        ])
+    ], [
+       PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
+       VLC_ADD_LIBS([pulse], [${X_LIBS} ${X_PRE_LIBS} -lX11])
+       AC_MSG_WARN(It is STRONGLY advised to update to pulse 0.9.22)
+    ])
 ])
 
+
 dnl
 dnl  Portaudio module
 dnl
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 367dead..2a0eaf9 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -34,10 +34,13 @@
 #include <vlc_cpu.h>
 
 #include <pulse/pulseaudio.h>
-#ifdef X_DISPLAY_MISSING
-# error Xlib required due to PulseAudio bug 799!
+
+#if !PA_CHECK_VERSION(0,9,22)
+    #ifdef X_DISPLAY_MISSING
+    # error Xlib required due to PulseAudio bug 799!
+    #endif
+    #include <vlc_xlib.h>
 #endif
-#include <vlc_xlib.h>
 
 #include <assert.h>
 
@@ -121,8 +124,10 @@ static int Open ( vlc_object_t *p_this )
     struct pa_channel_map map;
     char * p_client_name;
 
+#if !PA_CHECK_VERSION(0,9,22)
     if( !vlc_xlib_init( p_this ) )
         return VLC_EGENERIC;
+#endif
 
     /* Allocate structures */
     p_aout->output.p_sys = p_sys = calloc( 1, sizeof( aout_sys_t ) );



More information about the vlc-commits mailing list