changeset 34259:a9bfa5a9fcac

ao_alsa: drop check for sys/asoundlib.h and ALSA version The ALSA output driver uses some parts of the ALSA API that were introduced after the switch to alsa/asoundlib.h, so checking for the deprecated header location is pointless as it has no chance of working anyway. Also, now that both ALSA output and input work with the 0.9 and 1.0 series, there is no need to keep checking for the ALSA version.
author diego
date Mon, 14 Nov 2011 09:58:26 +0000
parents 11ab37356dd1
children 07a21268eb84
files configure libao2/ao_alsa.c
diffstat 2 files changed, 11 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Nov 14 09:58:24 2011 +0000
+++ b/configure	Mon Nov 14 09:58:26 2011 +0000
@@ -5487,50 +5487,19 @@
 fi
 echores "$_openal"
 
+
 echocheck "ALSA audio"
-if test "$_alloca" != yes ; then
-  _alsa=no
-  res_comment="alloca missing"
-fi
-if test "$_alsa" != no ; then
+if test "$_alloca" = yes && test "$_alsa" = auto ; then
   _alsa=no
-  cpp_condition_check 'sys/asoundlib.h'  '(SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)' -lasound $ld_dl $ld_pthread && _alsaver='0.9.x-sys'
-  cpp_condition_check 'alsa/asoundlib.h' '(SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)' -lasound $ld_dl $ld_pthread && _alsaver='0.9.x-alsa'
-  cpp_condition_check 'sys/asoundlib.h'  '(SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0)' -lasound $ld_dl $ld_pthread && _alsaver='1.0.x-sys'
-  cpp_condition_check 'alsa/asoundlib.h' '(SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0)' -lasound $ld_dl $ld_pthread && _alsaver='1.0.x-alsa'
-fi
-def_alsa='#undef CONFIG_ALSA'
-def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
-def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
-if test "$_alsaver" ; then
-  _alsa=yes
-  if test "$_alsaver" = '0.9.x-sys' ; then
-    aomodules="alsa $aomodules"
-    def_alsa='#define CONFIG_ALSA 1'
-    def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
-    res_comment="using alsa 0.9.x and sys/asoundlib.h"
-  elif test "$_alsaver" = '0.9.x-alsa' ; then
-    aomodules="alsa $aomodules"
-    def_alsa='#define CONFIG_ALSA 1'
-    def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
-    res_comment="using alsa 0.9.x and alsa/asoundlib.h"
-  elif test "$_alsaver" = '1.0.x-sys' ; then
-    aomodules="alsa $aomodules"
-    def_alsa='#define CONFIG_ALSA 1'
-    def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
-    res_comment="using alsa 1.0.x and sys/asoundlib.h"
-  elif test "$_alsaver" = '1.0.x-alsa' ; then
-    aomodules="alsa $aomodules"
-    def_alsa='#define CONFIG_ALSA 1'
-    def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
-    res_comment="using alsa 1.0.x and alsa/asoundlib.h"
-  else
-    _alsa=no
-    res_comment="unknown version"
-  fi
+  header_check alsa/asoundlib.h -lasound $ld_dl $ld_pthread && _alsa=yes
+fi
+if test "$_alsa" = yes ; then
+  aomodules="alsa $aomodules"
+  def_alsa='#define CONFIG_ALSA 1'
   extra_ldflags="$extra_ldflags -lasound $ld_dl $ld_pthread"
 else
   noaomodules="alsa $noaomodules"
+  def_alsa='#undef CONFIG_ALSA'
 fi
 echores "$_alsa"
 
@@ -8349,13 +8318,11 @@
 
 /* system headers */
 $def_alloca_h
-$def_alsa_asoundlib_h
 $def_altivec_h
 $def_malloc_h
 $def_mman_h
 $def_mman_has_map_failed
 $def_soundcard_h
-$def_sys_asoundlib_h
 $def_sys_soundcard_h
 $def_sys_sysinfo_h
 $def_sys_videoio_h
--- a/libao2/ao_alsa.c	Mon Nov 14 09:58:24 2011 +0000
+++ b/libao2/ao_alsa.c	Mon Nov 14 09:58:26 2011 +0000
@@ -34,25 +34,15 @@
 #include <math.h>
 #include <string.h>
 #include <alloca.h>
+#define ALSA_PCM_NEW_HW_PARAMS_API
+#define ALSA_PCM_NEW_SW_PARAMS_API
+#include <alsa/asoundlib.h>
 
 #include "config.h"
 #include "subopt-helper.h"
 #include "mixer.h"
 #include "mp_msg.h"
 #include "help_mp.h"
-
-#define ALSA_PCM_NEW_HW_PARAMS_API
-#define ALSA_PCM_NEW_SW_PARAMS_API
-
-#ifdef HAVE_SYS_ASOUNDLIB_H
-#include <sys/asoundlib.h>
-#elif defined(HAVE_ALSA_ASOUNDLIB_H)
-#include <alsa/asoundlib.h>
-#else
-#error "asoundlib.h is not in sys/ or alsa/ - please bugreport"
-#endif
-
-
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "libaf/af_format.h"