[MPlayer-dev-eng] [PATCH] Fix build with alsa 1.0.0pre1

Bernhard Rosenkraenzer bero at arklinux.org
Mon Nov 24 01:15:19 CET 2003


ALSA 1.0.x support the fast way -- this patch detects ALSA 1.0.x and puts 
it in 0.9 compatibility mode.

LLaP
bero

-- 
Ark Linux - Linux for the masses
http://www.arklinux.org/

Redistribution and processing of this message is subject to
http://www.arklinux.org/terms.php
-------------- next part --------------
--- mplayer/configure.alsa1	2003-11-24 00:21:54.000000000 +0100
+++ mplayer/configure	2003-11-24 00:24:57.000000000 +0100
@@ -3900,6 +3920,17 @@
 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
 EOF
   cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
+
+  cat > $TMPC << EOF
+#include <sys/asoundlib.h>
+int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
+EOF
+  cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
+  cat > $TMPC << EOF
+#include <alsa/asoundlib.h>
+int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
+EOF
+  cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
 fi
 _def_alsa5='#undef HAVE_ALSA5'
 _def_alsa9='#undef HAVE_ALSA9'
@@ -3924,6 +3955,22 @@
     _def_alsa9='#define HAVE_ALSA9 1'
     _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
     echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
+  elif test "$_alsaver" = '1.0.x-sys' ; then
+    _aosrc="$_aosrc ao_alsa9.c"
+    _aomodules="alsa9 $_aomodules"
+    _def_alsa9="#define ALSA_PCM_OLD_HW_PARAMS_API 1
+#define ALSA_PCM_OLD_SW_PARAMS_API 1
+#define HAVE_ALSA9 1"
+    _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
+    echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
+  elif test "$_alsaver" = '1.0.x-alsa' ; then
+    _aosrc="$_aosrc ao_alsa9.c"
+    _aomodules="alsa9 $_aomodules"
+    _def_alsa9="#define ALSA_PCM_OLD_HW_PARAMS_API 1
+#define ALSA_PCM_OLD_SW_PARAMS_API 1
+#define HAVE_ALSA9 1"
+    _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
+    echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
   fi
   _ld_alsa="-lasound $_ld_dl $_ld_pthread"
 else


More information about the MPlayer-dev-eng mailing list