]> git.sesse.net Git - vlc/commitdiff
Audio output 3. Expect major breakages.
authorChristophe Massiot <massiot@videolan.org>
Wed, 7 Aug 2002 21:36:56 +0000 (21:36 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 7 Aug 2002 21:36:56 +0000 (21:36 +0000)
52 files changed:
Makefile
bootstrap.sh
configure
configure.in
include/aout_internal.h [new file with mode: 0644]
include/audio_output.h
include/config.h
include/defs.h.in
include/vlc_common.h
include/vlc_symbols.h
modules/audio_filter/.cvsignore [moved from modules/audio_output/alsa/.cvsignore with 100% similarity]
modules/audio_filter/Makefile [new file with mode: 0644]
modules/audio_filter/float32tos16.c [new file with mode: 0644]
modules/audio_mixer/.cvsignore [moved from modules/audio_output/arts/.cvsignore with 100% similarity]
modules/audio_mixer/Makefile [new file with mode: 0644]
modules/audio_mixer/trivial.c [new file with mode: 0644]
modules/audio_output/.cvsignore [moved from modules/audio_output/dsp/.cvsignore with 100% similarity]
modules/audio_output/Makefile [new file with mode: 0644]
modules/audio_output/alsa.c [moved from modules/audio_output/alsa/alsa.c with 99% similarity]
modules/audio_output/alsa/Makefile [deleted file]
modules/audio_output/arts.c [moved from modules/audio_output/arts/arts.c with 100% similarity]
modules/audio_output/arts/Makefile [deleted file]
modules/audio_output/dsp/Makefile [deleted file]
modules/audio_output/esd.c [moved from modules/audio_output/esd/esd.c with 99% similarity]
modules/audio_output/esd/.cvsignore [deleted file]
modules/audio_output/esd/Makefile [deleted file]
modules/audio_output/file.c [new file with mode: 0644]
modules/audio_output/oss.c [moved from modules/audio_output/dsp/dsp.c with 53% similarity]
modules/audio_output/waveout.c [moved from modules/audio_output/waveout/waveout.c with 99% similarity]
modules/audio_output/waveout/.cvsignore [deleted file]
modules/audio_output/waveout/Makefile [deleted file]
modules/codec/a52/a52.c
modules/codec/a52/a52.h
modules/gui/macosx/aout.m
modules/gui/macosx/vout.m
modules/misc/dummy/aout.c
modules/misc/dummy/dummy.c
modules/video_output/sdl/aout.c
src/audio_output/aout_ext-dec.c [deleted file]
src/audio_output/aout_pcm.c [deleted file]
src/audio_output/aout_pcm.h [deleted file]
src/audio_output/aout_spdif.c [deleted file]
src/audio_output/aout_spdif.h [deleted file]
src/audio_output/audio_output.c
src/audio_output/filters.c [new file with mode: 0644]
src/audio_output/input.c [new file with mode: 0644]
src/audio_output/mixer.c [new file with mode: 0644]
src/audio_output/output.c [new file with mode: 0644]
src/libvlc.c
src/libvlc.h
src/misc/modules_plugin.h
src/misc/objects.c

index 3be52d120e3e5865da1f51b571ba6e19a7f2b448..373fc1dad0d814fa369ebf4e752e54b2e829b988 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ INTERFACE := interface intf_eject
 PLAYLIST := playlist
 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info
 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
-AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
+AUDIO_OUTPUT := audio_output filters input mixer output
 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
 
 LIBVLC_OBJ :=  $(LIBVLC:%=src/%.o) \
index e80cdbba4863de790a3f9ee53c861f30ba078db2..50637157713bba998d8169f246579e1218dc84f4 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ##  bootstrap.sh file for vlc, the VideoLAN Client
-##  $Id: bootstrap.sh,v 1.9 2002/08/07 00:29:36 sam Exp $
+##  $Id: bootstrap.sh,v 1.10 2002/08/07 21:36:55 massiot Exp $
 ##
 ##  Authors: Samuel Hocevar <sam@zoy.org>
 
@@ -73,7 +73,7 @@ echo "$file."
 echo -n " + fixing glade bugs: "
 for file in gnome_interface.c gtk_interface.c
 do
-if grep -q "DO NOT EDIT THIS FILE" modules/gui/gtk/$file
+if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
 then
     rm -f /tmp/$$.$file.bak
     cat > /tmp/$$.$file.bak << EOF
@@ -97,7 +97,7 @@ echo -n "$file "
 done
 
 file=gtk_support.h
-if grep -q "DO NOT EDIT THIS FILE" modules/gui/gtk/$file
+if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
 then
     rm -f /tmp/$$.$file.bak
     sed 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
index c5bc523be3ea79756c72df9d1df08c79313f9f53..863ed05b25bc1cdd4e208c91c599ef1eeb93979f 100755 (executable)
--- a/configure
+++ b/configure
@@ -79,7 +79,9 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-mp4            MP4 demux module (default disabled)"
 ac_help="$ac_help
-  --enable-a52            AC3 support with liba52 (default enabled)"
+  --enable-a52            A/52 support with liba52 (default enabled)"
+ac_help="$ac_help
+    --with-a52=PATH       a52 headers and libraries"
 ac_help="$ac_help
     --with-a52-tree=PATH  a52dec tree for static linking "
 ac_help="$ac_help
@@ -119,7 +121,7 @@ ac_help="$ac_help
 ac_help="$ac_help
 Audio plugins:"
 ac_help="$ac_help
-  --enable-dsp            Linux /dev/dsp support (enabled on Linux)"
+  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)"
 ac_help="$ac_help
   --enable-esd            Esound library support (default disabled)"
 ac_help="$ac_help
@@ -732,7 +734,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:736: checking host system type" >&5
+echo "configure:738: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -753,7 +755,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:757: checking target system type" >&5
+echo "configure:759: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -771,7 +773,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:775: checking build system type" >&5
+echo "configure:777: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -805,7 +807,7 @@ save_CFLAGS="${CFLAGS}"
 save_LDFLAGS="${LDFLAGS}"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:809: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:811: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -834,7 +836,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:838: checking for $ac_word" >&5
+echo "configure:840: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -864,7 +866,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:868: checking for $ac_word" >&5
+echo "configure:870: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -915,7 +917,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:919: checking for $ac_word" >&5
+echo "configure:921: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -947,7 +949,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:951: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:953: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -958,12 +960,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 962 "configure"
+#line 964 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -989,12 +991,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:993: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:995: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:998: checking whether we are using GNU C" >&5
+echo "configure:1000: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1003,7 +1005,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1022,7 +1024,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1026: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1028: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1054,7 +1056,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1058: checking how to run the C preprocessor" >&5
+echo "configure:1060: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1069,13 +1071,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1073 "configure"
+#line 1075 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1086,13 +1088,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1090 "configure"
+#line 1092 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1103,13 +1105,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1107 "configure"
+#line 1109 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1143,7 +1145,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1147: checking for $ac_word" >&5
+echo "configure:1149: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1175,7 +1177,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1179: checking for $ac_word" >&5
+echo "configure:1181: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1210,7 +1212,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1214: checking for $ac_word" >&5
+echo "configure:1216: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1242,7 +1244,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1246: checking for $ac_word" >&5
+echo "configure:1248: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1278,7 +1280,7 @@ fi
 # Extract the first word of "gmake", so it can be a program name with args.
 set dummy gmake; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1282: checking for $ac_word" >&5
+echo "configure:1284: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1313,7 +1315,7 @@ fi
 
 if test "x${GMAKE}" = "xno"; then
   echo $ac_n "checking whether GNU make is installed""... $ac_c" 1>&6
-echo "configure:1317: checking whether GNU make is installed" >&5
+echo "configure:1319: checking whether GNU make is installed" >&5
 if eval "test \"`echo '$''{'ac_cv_gmake'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1345,7 +1347,7 @@ EOF
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1349: checking for $ac_word" >&5
+echo "configure:1351: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1374,7 +1376,7 @@ fi
 
 
         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:1378: checking for strerror in -lcposix" >&5
+echo "configure:1380: checking for strerror in -lcposix" >&5
 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1382,7 +1384,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1386 "configure"
+#line 1388 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1393,7 +1395,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:1397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1416,12 +1418,12 @@ fi
   
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1420: checking for ANSI C header files" >&5
+echo "configure:1422: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1425 "configure"
+#line 1427 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1429,7 +1431,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1446,7 +1448,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1450 "configure"
+#line 1452 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1464,7 +1466,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1468 "configure"
+#line 1470 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1485,7 +1487,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1489 "configure"
+#line 1491 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1496,7 +1498,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1520,12 +1522,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1524: checking for working const" >&5
+echo "configure:1526: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1531 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1574,7 +1576,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1595,21 +1597,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1599: checking for inline" >&5
+echo "configure:1601: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 1606 "configure"
+#line 1608 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1635,12 +1637,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1639: checking for off_t" >&5
+echo "configure:1641: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1646 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1668,12 +1670,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1672: checking for size_t" >&5
+echo "configure:1674: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
+#line 1679 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1703,19 +1705,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1707: checking for working alloca.h" >&5
+echo "configure:1709: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1712 "configure"
+#line 1714 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -1736,12 +1738,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1740: checking for alloca" >&5
+echo "configure:1742: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1745 "configure"
+#line 1747 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1769,7 +1771,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -1801,12 +1803,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1805: checking whether alloca needs Cray hooks" >&5
+echo "configure:1807: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 1812 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1831,12 +1833,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1835: checking for $ac_func" >&5
+echo "configure:1837: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1840 "configure"
+#line 1842 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1859,7 +1861,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1886,7 +1888,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1890: checking stack direction for C alloca" >&5
+echo "configure:1892: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1894,7 +1896,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1898 "configure"
+#line 1900 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1913,7 +1915,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:1917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -1938,17 +1940,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1942: checking for $ac_hdr" >&5
+echo "configure:1944: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1947 "configure"
+#line 1949 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1977,12 +1979,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1981: checking for $ac_func" >&5
+echo "configure:1983: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1986 "configure"
+#line 1988 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2005,7 +2007,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2030,7 +2032,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2034: checking for working mmap" >&5
+echo "configure:2036: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2038,7 +2040,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2042 "configure"
+#line 2044 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2178,7 +2180,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2202,12 +2204,12 @@ fi
 
 
     echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:2206: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:2208: checking whether we are using the GNU C Library 2.1 or newer" >&5
 if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+#line 2213 "configure"
 #include "confdefs.h"
 
 #include <features.h>
@@ -2243,17 +2245,17 @@ stdlib.h string.h unistd.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2247: checking for $ac_hdr" >&5
+echo "configure:2249: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2252 "configure"
+#line 2254 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2284,12 +2286,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
 strdup strtoul tsearch __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2288: checking for $ac_func" >&5
+echo "configure:2290: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2293 "configure"
+#line 2295 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2312,7 +2314,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2352,7 +2354,7 @@ fi
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:2356: checking for iconv" >&5
+echo "configure:2358: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2360,7 +2362,7 @@ else
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 2364 "configure"
+#line 2366 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2370,7 +2372,7 @@ iconv_t cd = iconv_open("","");
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -2382,7 +2384,7 @@ rm -f conftest*
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 2386 "configure"
+#line 2388 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2392,7 +2394,7 @@ iconv_t cd = iconv_open("","");
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_lib_iconv=yes
         am_cv_func_iconv=yes
@@ -2413,13 +2415,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:2417: checking for iconv declaration" >&5
+echo "configure:2419: checking for iconv declaration" >&5
     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 2423 "configure"
+#line 2425 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -2438,7 +2440,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
@@ -2467,19 +2469,19 @@ EOF
 
    
   echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:2471: checking for nl_langinfo and CODESET" >&5
+echo "configure:2473: checking for nl_langinfo and CODESET" >&5
 if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2476 "configure"
+#line 2478 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int main() {
 char* cs = nl_langinfo(CODESET);
 ; return 0; }
 EOF
-if { (eval echo configure:2483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_langinfo_codeset=yes
 else
@@ -2502,19 +2504,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2506: checking for LC_MESSAGES" >&5
+echo "configure:2508: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2511 "configure"
+#line 2513 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -2535,7 +2537,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2539: checking whether NLS is requested" >&5
+echo "configure:2541: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -2557,7 +2559,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2561: checking whether included gettext is requested" >&5
+echo "configure:2563: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -2577,17 +2579,17 @@ fi
 
        ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2581: checking for libintl.h" >&5
+echo "configure:2583: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2586 "configure"
+#line 2588 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2604,12 +2606,12 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:2608: checking for GNU gettext in libc" >&5
+echo "configure:2610: checking for GNU gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2613 "configure"
+#line 2615 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2618,7 +2620,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libc=yes
 else
@@ -2634,14 +2636,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
 
           if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
             echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:2638: checking for GNU gettext in libintl" >&5
+echo "configure:2640: checking for GNU gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   gt_save_LIBS="$LIBS"
                LIBS="$LIBS -lintl $LIBICONV"
                cat > conftest.$ac_ext <<EOF
-#line 2645 "configure"
+#line 2647 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2650,7 +2652,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libintl=yes
 else
@@ -2683,12 +2685,12 @@ EOF
             for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2687: checking for $ac_func" >&5
+echo "configure:2689: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2692 "configure"
+#line 2694 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2711,7 +2713,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2740,7 +2742,7 @@ done
                     # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2744: checking for $ac_word" >&5
+echo "configure:2746: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2774,7 +2776,7 @@ fi
             # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2778: checking for $ac_word" >&5
+echo "configure:2780: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2811,7 +2813,7 @@ fi
                     # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2815: checking for $ac_word" >&5
+echo "configure:2817: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2861,7 +2863,7 @@ fi
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2865: checking for $ac_word" >&5
+echo "configure:2867: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2895,7 +2897,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2899: checking for $ac_word" >&5
+echo "configure:2901: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2931,7 +2933,7 @@ fi
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2935: checking for $ac_word" >&5
+echo "configure:2937: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3002,7 +3004,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3006: checking for $ac_word" >&5
+echo "configure:3008: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3035,7 +3037,7 @@ done
       ac_verc_fail=yes
     else
             echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:3039: checking version of bison" >&5
+echo "configure:3041: checking version of bison" >&5
       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
       case $ac_prog_version in
         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -3082,7 +3084,7 @@ echo "configure:3039: checking version of bison" >&5
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3086: checking for catalogs to be installed" >&5
+echo "configure:3088: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for presentlang in $ALL_LINGUAS; do
          useit=no
@@ -3134,7 +3136,7 @@ echo "configure:3086: checking for catalogs to be installed" >&5
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3138: checking for a BSD compatible install" >&5
+echo "configure:3140: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3216,7 +3218,7 @@ case "x${target_os}" in
     # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ac_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3220: checking for $ac_word" >&5
+echo "configure:3222: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3248,7 +3250,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3252: checking for $ac_word" >&5
+echo "configure:3254: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3322,12 +3324,12 @@ save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefgh
 for ac_func in gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3326: checking for $ac_func" >&5
+echo "configure:3328: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3331 "configure"
+#line 3333 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3350,7 +3352,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3376,12 +3378,12 @@ done
 
 
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3380: checking for connect" >&5
+echo "configure:3382: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3385 "configure"
+#line 3387 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3404,7 +3406,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3423,7 +3425,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3427: checking for connect in -lsocket" >&5
+echo "configure:3429: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3431,7 +3433,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3435 "configure"
+#line 3437 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3442,7 +3444,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3467,12 +3469,12 @@ fi
 fi
 
 echo $ac_n "checking for send""... $ac_c" 1>&6
-echo "configure:3471: checking for send" >&5
+echo "configure:3473: checking for send" >&5
 if eval "test \"`echo '$''{'ac_cv_func_send'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3476 "configure"
+#line 3478 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char send(); below.  */
@@ -3495,7 +3497,7 @@ send();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_send=yes"
 else
@@ -3514,7 +3516,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for send in -lsocket""... $ac_c" 1>&6
-echo "configure:3518: checking for send in -lsocket" >&5
+echo "configure:3520: checking for send in -lsocket" >&5
 ac_lib_var=`echo socket'_'send | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3522,7 +3524,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3526 "configure"
+#line 3528 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3533,7 +3535,7 @@ int main() {
 send()
 ; return 0; }
 EOF
-if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3557,12 +3559,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3561: checking for gethostbyname" >&5
+echo "configure:3563: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3566 "configure"
+#line 3568 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3585,7 +3587,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3604,7 +3606,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3608: checking for gethostbyname in -lnsl" >&5
+echo "configure:3610: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3612,7 +3614,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3616 "configure"
+#line 3618 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3623,7 +3625,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3647,12 +3649,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3651: checking for gethostbyname" >&5
+echo "configure:3653: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3656 "configure"
+#line 3658 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3675,7 +3677,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3694,7 +3696,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lbind""... $ac_c" 1>&6
-echo "configure:3698: checking for gethostbyname in -lbind" >&5
+echo "configure:3700: checking for gethostbyname in -lbind" >&5
 ac_lib_var=`echo bind'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3702,7 +3704,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3706 "configure"
+#line 3708 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3713,7 +3715,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3738,12 +3740,12 @@ fi
 
 have_nanosleep=0
 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:3742: checking for nanosleep" >&5
+echo "configure:3744: checking for nanosleep" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3747 "configure"
+#line 3749 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nanosleep(); below.  */
@@ -3766,7 +3768,7 @@ nanosleep();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nanosleep=yes"
 else
@@ -3785,7 +3787,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:3789: checking for nanosleep in -lrt" >&5
+echo "configure:3791: checking for nanosleep in -lrt" >&5
 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3793,7 +3795,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3797 "configure"
+#line 3799 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3804,7 +3806,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3823,7 +3825,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:3827: checking for nanosleep in -lposix4" >&5
+echo "configure:3829: checking for nanosleep in -lposix4" >&5
 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3831,7 +3833,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3835 "configure"
+#line 3837 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3842,7 +3844,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3876,7 +3878,7 @@ EOF
 fi
 # HP/UX port
 echo $ac_n "checking for sem_init in -lrt""... $ac_c" 1>&6
-echo "configure:3880: checking for sem_init in -lrt" >&5
+echo "configure:3882: checking for sem_init in -lrt" >&5
 ac_lib_var=`echo rt'_'sem_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3884,7 +3886,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3888 "configure"
+#line 3890 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3895,7 +3897,7 @@ int main() {
 sem_init()
 ; return 0; }
 EOF
-if { (eval echo configure:3899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3917,12 +3919,12 @@ fi
 
 
 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:3921: checking for inet_aton" >&5
+echo "configure:3923: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3926 "configure"
+#line 3928 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -3945,7 +3947,7 @@ inet_aton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -3964,7 +3966,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:3968: checking for inet_aton in -lresolv" >&5
+echo "configure:3970: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3972,7 +3974,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3976 "configure"
+#line 3978 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3983,7 +3985,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:3987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4007,12 +4009,12 @@ fi
 fi
 
 echo $ac_n "checking for textdomain""... $ac_c" 1>&6
-echo "configure:4011: checking for textdomain" >&5
+echo "configure:4013: checking for textdomain" >&5
 if eval "test \"`echo '$''{'ac_cv_func_textdomain'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4016 "configure"
+#line 4018 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char textdomain(); below.  */
@@ -4035,7 +4037,7 @@ textdomain();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_textdomain=yes"
 else
@@ -4054,7 +4056,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for textdomain in -lintl""... $ac_c" 1>&6
-echo "configure:4058: checking for textdomain in -lintl" >&5
+echo "configure:4060: checking for textdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'textdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4062,7 +4064,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4066 "configure"
+#line 4068 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4073,7 +4075,7 @@ int main() {
 textdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4101,12 +4103,12 @@ fi
 
 NEED_GETOPT=0
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:4105: checking for getopt_long" >&5
+echo "configure:4107: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4110 "configure"
+#line 4112 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -4129,7 +4131,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -4151,7 +4153,7 @@ else
   echo "$ac_t""no" 1>&6
  # FreeBSD has a gnugetopt library for this:
   echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:4155: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:4157: checking for getopt_long in -lgnugetopt" >&5
 ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4159,7 +4161,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnugetopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4163 "configure"
+#line 4165 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4170,7 +4172,7 @@ int main() {
 getopt_long()
 ; return 0; }
 EOF
-if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4198,12 +4200,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4202: checking return type of signal handlers" >&5
+echo "configure:4204: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4207 "configure"
+#line 4209 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -4220,7 +4222,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:4224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -4239,7 +4241,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4243: checking for dlopen in -ldl" >&5
+echo "configure:4245: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4247,7 +4249,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4251 "configure"
+#line 4253 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4258,7 +4260,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4279,7 +4281,7 @@ else
 fi
 
 echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
-echo "configure:4283: checking for cos in -lm" >&5
+echo "configure:4285: checking for cos in -lm" >&5
 ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4287,7 +4289,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4291 "configure"
+#line 4293 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4298,7 +4300,7 @@ int main() {
 cos()
 ; return 0; }
 EOF
-if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4320,7 +4322,7 @@ else
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:4324: checking for pow in -lm" >&5
+echo "configure:4326: checking for pow in -lm" >&5
 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4328,7 +4330,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4332 "configure"
+#line 4334 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4339,7 +4341,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4368,7 +4370,7 @@ fi
 THREAD_LIB=error
 if test "x${THREAD_LIB}" = "xerror"; then
   echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6
-echo "configure:4372: checking for main in -lpthread" >&5
+echo "configure:4374: checking for main in -lpthread" >&5
 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4376,14 +4378,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4380 "configure"
+#line 4382 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4406,7 +4408,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = "xerror"; then
   echo $ac_n "checking for main in -lpthreads""... $ac_c" 1>&6
-echo "configure:4410: checking for main in -lpthreads" >&5
+echo "configure:4412: checking for main in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4414,14 +4416,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4418 "configure"
+#line 4420 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4444,7 +4446,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = "xerror"; then
   echo $ac_n "checking for main in -lc_r""... $ac_c" 1>&6
-echo "configure:4448: checking for main in -lc_r" >&5
+echo "configure:4450: checking for main in -lc_r" >&5
 ac_lib_var=`echo c_r'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4452,14 +4454,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+#line 4458 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4482,12 +4484,12 @@ fi
 fi
 if test "x${THREAD_LIB}" = "xerror"; then
   echo $ac_n "checking for pthread_mutex_lock""... $ac_c" 1>&6
-echo "configure:4486: checking for pthread_mutex_lock" >&5
+echo "configure:4488: checking for pthread_mutex_lock" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_mutex_lock'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4491 "configure"
+#line 4493 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_mutex_lock(); below.  */
@@ -4510,7 +4512,7 @@ pthread_mutex_lock();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_mutex_lock=yes"
 else
@@ -4533,7 +4535,7 @@ fi
 fi
 
 echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6
-echo "configure:4537: checking for cthread_fork in -lthreads" >&5
+echo "configure:4539: checking for cthread_fork in -lthreads" >&5
 ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4541,7 +4543,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4545 "configure"
+#line 4547 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4552,7 +4554,7 @@ int main() {
 cthread_fork()
 ; return 0; }
 EOF
-if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4574,7 +4576,7 @@ fi
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4578 "configure"
+#line 4580 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -4590,7 +4592,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 4594 "configure"
+#line 4596 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -4606,7 +4608,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 4610 "configure"
+#line 4612 "configure"
 #include "confdefs.h"
 #include <strings.h>
 EOF
@@ -4626,17 +4628,17 @@ for ac_hdr in stdint.h getopt.h strings.h inttypes.h sys/int_types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4630: checking for $ac_hdr" >&5
+echo "configure:4632: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4635 "configure"
+#line 4637 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4666,17 +4668,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4670: checking for $ac_hdr" >&5
+echo "configure:4672: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4675 "configure"
+#line 4677 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4706,17 +4708,17 @@ for ac_hdr in dlfcn.h image.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4710: checking for $ac_hdr" >&5
+echo "configure:4712: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4715 "configure"
+#line 4717 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4746,17 +4748,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4750: checking for $ac_hdr" >&5
+echo "configure:4752: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4755 "configure"
+#line 4757 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4786,17 +4788,17 @@ for ac_hdr in machine/param.h sys/shm.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4790: checking for $ac_hdr" >&5
+echo "configure:4792: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4795 "configure"
+#line 4797 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4826,17 +4828,17 @@ for ac_hdr in linux/version.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4830: checking for $ac_hdr" >&5
+echo "configure:4832: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4835 "configure"
+#line 4837 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4864,12 +4866,12 @@ done
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4868: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4870: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4873 "configure"
+#line 4875 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4878,7 +4880,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4900,7 +4902,7 @@ fi
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4904 "configure"
+#line 4906 "configure"
 #include "confdefs.h"
 #include <time.h>
 EOF
@@ -4918,7 +4920,7 @@ rm -f conftest*
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4922 "configure"
+#line 4924 "configure"
 #include "confdefs.h"
 #include <sys/time.h>
 EOF
@@ -4939,17 +4941,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4943: checking for $ac_hdr" >&5
+echo "configure:4945: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4948 "configure"
+#line 4950 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4990,17 +4992,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4994: checking for $ac_hdr" >&5
+echo "configure:4996: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4999 "configure"
+#line 5001 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5022,7 +5024,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
     cat > conftest.$ac_ext <<EOF
-#line 5026 "configure"
+#line 5028 "configure"
 #include "confdefs.h"
 #include <X11/extensions/dpms.h>
 EOF
@@ -5048,20 +5050,20 @@ done
 fi
 
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:5052: checking for ntohl in sys/param.h" >&5
+echo "configure:5054: checking for ntohl in sys/param.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ntohl_sys_param_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -Wall -Werror"
      cat > conftest.$ac_ext <<EOF
-#line 5058 "configure"
+#line 5060 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 int main() {
 void foo() { int meuh; ntohl(meuh); }
 ; return 0; }
 EOF
-if { (eval echo configure:5065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ntohl_sys_param_h=yes
 else
@@ -5082,20 +5084,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
-echo "configure:5086: checking if \$CC accepts -finline-limit" >&5
+echo "configure:5088: checking if \$CC accepts -finline-limit" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline_limit'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -finline-limit-30000"
      cat > conftest.$ac_ext <<EOF
-#line 5092 "configure"
+#line 5094 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline_limit=yes
 else
@@ -5113,20 +5115,20 @@ if test "x${ac_cv_c_inline_limit}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -Wall -Winline""... $ac_c" 1>&6
-echo "configure:5117: checking if \$CC accepts -Wall -Winline" >&5
+echo "configure:5119: checking if \$CC accepts -Wall -Winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_Wall_Winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="-Wall -Winline ${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5123 "configure"
+#line 5125 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_Wall_Winline=yes
 else
@@ -5143,20 +5145,20 @@ if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
     save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
 else
     echo $ac_n "checking if \$CC accepts -wall -winline""... $ac_c" 1>&6
-echo "configure:5147: checking if \$CC accepts -wall -winline" >&5
+echo "configure:5149: checking if \$CC accepts -wall -winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_wall_winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="-wall -winline ${save_CFLAGS}"
          cat > conftest.$ac_ext <<EOF
-#line 5153 "configure"
+#line 5155 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_wall_winline=yes
 else
@@ -5175,20 +5177,20 @@ echo "$ac_t""$ac_cv_c_wall_winline" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -pipe""... $ac_c" 1>&6
-echo "configure:5179: checking if \$CC accepts -pipe" >&5
+echo "configure:5181: checking if \$CC accepts -pipe" >&5
 if eval "test \"`echo '$''{'ac_cv_c_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -pipe"
      cat > conftest.$ac_ext <<EOF
-#line 5185 "configure"
+#line 5187 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_pipe=yes
 else
@@ -5206,20 +5208,20 @@ if test "x${ac_cv_c_pipe}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -O3""... $ac_c" 1>&6
-echo "configure:5210: checking if \$CC accepts -O3" >&5
+echo "configure:5212: checking if \$CC accepts -O3" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o3'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O3"
      cat > conftest.$ac_ext <<EOF
-#line 5216 "configure"
+#line 5218 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o3=yes
 else
@@ -5236,20 +5238,20 @@ if test "x${ac_cv_c_o3}" != "xno"; then
     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
 else
     echo $ac_n "checking if \$CC accepts -O2""... $ac_c" 1>&6
-echo "configure:5240: checking if \$CC accepts -O2" >&5
+echo "configure:5242: checking if \$CC accepts -O2" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O2"
          cat > conftest.$ac_ext <<EOF
-#line 5246 "configure"
+#line 5248 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o2=yes
 else
@@ -5266,20 +5268,20 @@ echo "$ac_t""$ac_cv_c_o2" 1>&6
         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
     else
         echo $ac_n "checking if \$CC accepts -O""... $ac_c" 1>&6
-echo "configure:5270: checking if \$CC accepts -O" >&5
+echo "configure:5272: checking if \$CC accepts -O" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O"
              cat > conftest.$ac_ext <<EOF
-#line 5276 "configure"
+#line 5278 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o=yes
 else
@@ -5299,20 +5301,20 @@ echo "$ac_t""$ac_cv_c_o" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -ffast-math""... $ac_c" 1>&6
-echo "configure:5303: checking if \$CC accepts -ffast-math" >&5
+echo "configure:5305: checking if \$CC accepts -ffast-math" >&5
 if eval "test \"`echo '$''{'ac_cv_c_fast_math'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -ffast-math"
      cat > conftest.$ac_ext <<EOF
-#line 5309 "configure"
+#line 5311 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_fast_math=yes
 else
@@ -5330,20 +5332,20 @@ if test "x${ac_cv_c_fast_math}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -funroll-loops""... $ac_c" 1>&6
-echo "configure:5334: checking if \$CC accepts -funroll-loops" >&5
+echo "configure:5336: checking if \$CC accepts -funroll-loops" >&5
 if eval "test \"`echo '$''{'ac_cv_c_unroll_loops'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -funroll-loops"
      cat > conftest.$ac_ext <<EOF
-#line 5340 "configure"
+#line 5342 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_unroll_loops=yes
 else
@@ -5361,20 +5363,20 @@ if test "x${ac_cv_c_unroll_loops}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -fomit-frame-pointer""... $ac_c" 1>&6
-echo "configure:5365: checking if \$CC accepts -fomit-frame-pointer" >&5
+echo "configure:5367: checking if \$CC accepts -fomit-frame-pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_c_omit_frame_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
      cat > conftest.$ac_ext <<EOF
-#line 5371 "configure"
+#line 5373 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_omit_frame_pointer=yes
 else
@@ -5394,20 +5396,20 @@ if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -bundle -undefined error -lcc_dynamic""... $ac_c" 1>&6
-echo "configure:5398: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
+echo "configure:5400: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_darwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
      cat > conftest.$ac_ext <<EOF
-#line 5404 "configure"
+#line 5406 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_darwin=yes
 else
@@ -5425,20 +5427,20 @@ if test "x${ac_cv_ld_darwin}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
-echo "configure:5429: checking if \$CC accepts -shared" >&5
+echo "configure:5431: checking if \$CC accepts -shared" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -shared"
      cat > conftest.$ac_ext <<EOF
-#line 5435 "configure"
+#line 5437 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_plugins=yes
 else
@@ -5456,13 +5458,13 @@ if test "x${ac_cv_ld_plugins}" != "xno"; then
 fi
         
 echo $ac_n "checking for variadic cpp macros""... $ac_c" 1>&6
-echo "configure:5460: checking for variadic cpp macros" >&5
+echo "configure:5462: checking for variadic cpp macros" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_variadic_macros'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5466 "configure"
+#line 5468 "configure"
 #include "confdefs.h"
 #include <stdio.h>
           #define a(b,c...) printf(b,##c)
@@ -5470,7 +5472,7 @@ int main() {
 a("foo");a("%s","bar");a("%s%s","baz","quux");
 ; return 0; }
 EOF
-if { (eval echo configure:5474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cpp_variadic_macros=yes
 else
@@ -5491,7 +5493,7 @@ EOF
 fi
 
 echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
-echo "configure:5495: checking __attribute__ ((aligned ())) support" >&5
+echo "configure:5497: checking __attribute__ ((aligned ())) support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5499,14 +5501,14 @@ else
         CFLAGS="${save_CFLAGS} -Werror"
     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
         cat > conftest.$ac_ext <<EOF
-#line 5503 "configure"
+#line 5505 "configure"
 #include "confdefs.h"
 
 int main() {
 static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;
 ; return 0; }
 EOF
-if { (eval echo configure:5510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"
 else
@@ -5539,9 +5541,12 @@ BUILTINS="${BUILTINS}"
 PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
-PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/mpeg_video/mpeg_video codec/lpcm/lpcm codec/spdif/spdif codec/spudec/spudec"
+PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec"
+#PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/lpcm/lpcm codec/spdif/spdif"
 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
-PLUGINS="${PLUGINS} visualization/scope/scope"
+PLUGINS="${PLUGINS} audio_mixer/trivial"
+PLUGINS="${PLUGINS} audio_output/file"
+#PLUGINS="${PLUGINS} visualization/scope/scope"
 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
 
 MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
@@ -5551,20 +5556,20 @@ SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
 ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:5555: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:5560: checking if \$CC groks MMX inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5561 "configure"
+#line 5566 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmx_inline=yes
 else
@@ -5582,20 +5587,20 @@ if test "x${ac_cv_mmx_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
-echo "configure:5586: checking if \$CC groks MMX EXT inline assembly" >&5
+echo "configure:5591: checking if \$CC groks MMX EXT inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5592 "configure"
+#line 5597 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmxext_inline=yes
 else
@@ -5613,20 +5618,20 @@ if test "x${ac_cv_mmxext_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
-echo "configure:5617: checking if \$CC groks 3D Now! inline assembly" >&5
+echo "configure:5622: checking if \$CC groks 3D Now! inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5623 "configure"
+#line 5628 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_3dnow_inline=yes
 else
@@ -5648,20 +5653,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
-echo "configure:5652: checking if \$CC groks SSE inline assembly" >&5
+echo "configure:5657: checking if \$CC groks SSE inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5658 "configure"
+#line 5663 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sse_inline=yes
 else
@@ -5686,20 +5691,20 @@ fi
 # we should be able to remove this test with future versions of mingw32
 if test "x${SYS}" != "xmingw32"; then
 echo $ac_n "checking if \$CC groks AltiVec inline assembly""... $ac_c" 1>&6
-echo "configure:5690: checking if \$CC groks AltiVec inline assembly" >&5
+echo "configure:5695: checking if \$CC groks AltiVec inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5696 "configure"
+#line 5701 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline=yes
 else
@@ -5708,14 +5713,14 @@ else
   rm -rf conftest*
   CFLAGS="${save_CFLAGS} -Wa,-m7400"
           cat > conftest.$ac_ext <<EOF
-#line 5712 "configure"
+#line 5717 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline="-Wa,-m7400"
 else
@@ -5746,21 +5751,21 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks AltiVec C extensions""... $ac_c" 1>&6
-echo "configure:5750: checking if \$CC groks AltiVec C extensions" >&5
+echo "configure:5755: checking if \$CC groks AltiVec C extensions" >&5
 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -faltivec"
      # Darwin test
      cat > conftest.$ac_ext <<EOF
-#line 5757 "configure"
+#line 5762 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec=-faltivec
 else
@@ -5771,14 +5776,14 @@ else
         # Linux/PPC test
         CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
         cat > conftest.$ac_ext <<EOF
-#line 5775 "configure"
+#line 5780 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec="-fvec"
 else
@@ -5808,20 +5813,20 @@ EOF
 fi
 
 echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
-echo "configure:5812: checking if linker needs -framework vecLib" >&5
+echo "configure:5817: checking if linker needs -framework vecLib" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
      cat > conftest.$ac_ext <<EOF
-#line 5818 "configure"
+#line 5823 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_altivec=yes
 else
@@ -5953,17 +5958,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5957: checking for $ac_hdr" >&5
+echo "configure:5962: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5962 "configure"
+#line 5967 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5994,7 +5999,7 @@ done
 
     else
       echo $ac_n "checking for libdvdcss.a in ${with_dvdcss_tree}""... $ac_c" 1>&6
-echo "configure:5998: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
+echo "configure:6003: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
       if test "x${real_dvdcss_tree}" = "x"
       then
@@ -6020,7 +6025,7 @@ echo "configure:5998: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
   ;;
   *)
     echo $ac_n "checking for dvdcss headers in ${with_dvdcss}""... $ac_c" 1>&6
-echo "configure:6024: checking for dvdcss headers in ${with_dvdcss}" >&5
+echo "configure:6029: checking for dvdcss headers in ${with_dvdcss}" >&5
     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
     then
             echo "$ac_t""yes" 1>&6
@@ -6062,17 +6067,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6066: checking for $ac_hdr" >&5
+echo "configure:6071: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6071 "configure"
+#line 6076 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6094,14 +6099,14 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
      cat > conftest.$ac_ext <<EOF
-#line 6098 "configure"
+#line 6103 "configure"
 #include "confdefs.h"
 #include <dvdread/dvd_reader.h>
 int main() {
 void foo() { int i=DVD_VIDEO_LB_LEN; }
 ; return 0; }
 EOF
-if { (eval echo configure:6105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
           PLUGINS="${PLUGINS} access/dvdread/dvdread"
@@ -6166,17 +6171,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6170: checking for $ac_hdr" >&5
+echo "configure:6175: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6175 "configure"
+#line 6180 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6248,17 +6253,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6252: checking for $ac_hdr" >&5
+echo "configure:6257: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6257 "configure"
+#line 6262 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6287,7 +6292,7 @@ done
 
     else
       echo $ac_n "checking for libdvbpsi.a in ${with_dvbpsi_tree}""... $ac_c" 1>&6
-echo "configure:6291: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
+echo "configure:6296: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
       if test "x${real_dvbpsi_tree}" = "x"
       then
@@ -6310,7 +6315,7 @@ echo "configure:6291: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       ;;
   *)
     echo $ac_n "checking for dvbpsi headers in ${with_dvbpsi}""... $ac_c" 1>&6
-echo "configure:6314: checking for dvbpsi headers in ${with_dvbpsi}" >&5
+echo "configure:6319: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     if test "x${with_dvbpsi}" = "x"
     then
       test_LDFLAGS=""
@@ -6322,17 +6327,17 @@ echo "configure:6314: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
     ac_safe=`echo "dvbpsi/dr.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dvbpsi/dr.h""... $ac_c" 1>&6
-echo "configure:6326: checking for dvbpsi/dr.h" >&5
+echo "configure:6331: checking for dvbpsi/dr.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6331 "configure"
+#line 6336 "configure"
 #include "confdefs.h"
 #include <dvbpsi/dr.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6380,17 +6385,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6384: checking for $ac_hdr" >&5
+echo "configure:6389: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6389 "configure"
+#line 6394 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6430,7 +6435,7 @@ fi
 if test "x${enable_vcd}" != "xno"
 then
   cat > conftest.$ac_ext <<EOF
-#line 6434 "configure"
+#line 6439 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -6445,7 +6450,7 @@ rm -f conftest*
 
   
   cat > conftest.$ac_ext <<EOF
-#line 6449 "configure"
+#line 6454 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -6489,12 +6494,12 @@ if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
 then
   have_ipv6=0
   echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
-echo "configure:6493: checking for inet_pton" >&5
+echo "configure:6498: checking for inet_pton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_pton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6498 "configure"
+#line 6503 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_pton(); below.  */
@@ -6517,7 +6522,7 @@ inet_pton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_pton=yes"
 else
@@ -6536,7 +6541,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for inet_pton in -lresolv""... $ac_c" 1>&6
-echo "configure:6540: checking for inet_pton in -lresolv" >&5
+echo "configure:6545: checking for inet_pton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_pton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6544,7 +6549,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6548 "configure"
+#line 6553 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6555,7 +6560,7 @@ int main() {
 inet_pton()
 ; return 0; }
 EOF
-if { (eval echo configure:6559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6580,9 +6585,9 @@ fi
 fi
 
   echo $ac_n "checking for sockaddr_in6 in netinet/in.h""... $ac_c" 1>&6
-echo "configure:6584: checking for sockaddr_in6 in netinet/in.h" >&5
+echo "configure:6589: checking for sockaddr_in6 in netinet/in.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6586 "configure"
+#line 6591 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
@@ -6603,9 +6608,9 @@ fi
 if test "x${SYS}" = "xmingw32"
 then
   echo $ac_n "checking for getaddrinfo in ws2tcpip.h""... $ac_c" 1>&6
-echo "configure:6607: checking for getaddrinfo in ws2tcpip.h" >&5
+echo "configure:6612: checking for getaddrinfo in ws2tcpip.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6609 "configure"
+#line 6614 "configure"
 #include "confdefs.h"
 #include <ws2tcpip.h>
 EOF
@@ -6676,7 +6681,7 @@ fi
       { echo "configure: error: ${with_mad_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for mad.h in ${real_mad_tree}/libmad""... $ac_c" 1>&6
-echo "configure:6680: checking for mad.h in ${real_mad_tree}/libmad" >&5
+echo "configure:6685: checking for mad.h in ${real_mad_tree}/libmad" >&5
     if test -f ${real_mad_tree}/libmad/mad.h
     then
       echo "$ac_t""yes" 1>&6
@@ -6684,7 +6689,7 @@ echo "configure:6680: checking for mad.h in ${real_mad_tree}/libmad" >&5
       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
       echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6688: checking for mad_bit_init in -lmad" >&5
+echo "configure:6693: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6692,7 +6697,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6696 "configure"
+#line 6701 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6703,7 +6708,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6719,7 +6724,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-        BUILTINS="${BUILTINS} codec/mad/mad"
+        #BUILTINS="${BUILTINS} codec/mad/mad"
         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
         
 else
@@ -6740,17 +6745,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6744: checking for $ac_hdr" >&5
+echo "configure:6749: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6749 "configure"
+#line 6754 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6778,7 +6783,7 @@ fi
 done
 
     echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6782: checking for mad_bit_init in -lmad" >&5
+echo "configure:6787: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6786,7 +6791,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6790 "configure"
+#line 6795 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6797,7 +6802,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6813,7 +6818,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-      PLUGINS="${PLUGINS} codec/mad/mad"
+      #PLUGINS="${PLUGINS} codec/mad/mad"
       mad_LDFLAGS="${mad_LDFLAGS} -lmad" 
 else
   echo "$ac_t""no" 1>&6
@@ -6864,7 +6869,7 @@ fi
   if test "x${with_ffmpeg_tree}" != "x"
   then
     echo $ac_n "checking for libavcodec.a in ${with_ffmpeg_tree}""... $ac_c" 1>&6
-echo "configure:6868: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
+echo "configure:6873: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x${real_ffmpeg_tree}" = x
     then
@@ -6885,7 +6890,7 @@ echo "configure:6868: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
     echo $ac_n "checking for avcodec_init in -lavcodec""... $ac_c" 1>&6
-echo "configure:6889: checking for avcodec_init in -lavcodec" >&5
+echo "configure:6894: checking for avcodec_init in -lavcodec" >&5
 ac_lib_var=`echo avcodec'_'avcodec_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6893,7 +6898,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lavcodec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6897 "configure"
+#line 6902 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6904,7 +6909,7 @@ int main() {
 avcodec_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6942,17 +6947,17 @@ if test "x${enable_mp4}" = "xyes"
 then
     ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
-echo "configure:6946: checking for zlib.h" >&5
+echo "configure:6951: checking for zlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6951 "configure"
+#line 6956 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6969,7 +6974,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for inflateEnd in -lz""... $ac_c" 1>&6
-echo "configure:6973: checking for inflateEnd in -lz" >&5
+echo "configure:6978: checking for inflateEnd in -lz" >&5
 ac_lib_var=`echo z'_'inflateEnd | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6977,7 +6982,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6981 "configure"
+#line 6986 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6988,7 +6993,7 @@ int main() {
 inflateEnd()
 ; return 0; }
 EOF
-if { (eval echo configure:6992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7025,6 +7030,12 @@ fi
 
 if test "x${enable_a52}" != "xno"
 then
+  # Check whether --with-a52 or --without-a52 was given.
+if test "${with_a52+set}" = set; then
+  withval="$with_a52"
+  :
+fi
+
   # Check whether --with-a52-tree or --without-a52-tree was given.
 if test "${with_a52_tree+set}" = set; then
   withval="$with_a52_tree"
@@ -7040,7 +7051,7 @@ fi
       { echo "configure: error: ${with_a52_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for a52.h in ${real_a52_tree}/include""... $ac_c" 1>&6
-echo "configure:7044: checking for a52.h in ${real_a52_tree}/include" >&5
+echo "configure:7055: checking for a52.h in ${real_a52_tree}/include" >&5
     if test -f ${real_a52_tree}/include/a52.h
     then
       echo "$ac_t""yes" 1>&6
@@ -7048,7 +7059,7 @@ echo "configure:7044: checking for a52.h in ${real_a52_tree}/include" >&5
       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:7052: checking for a52_free in -la52" >&5
+echo "configure:7063: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7056,7 +7067,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7060 "configure"
+#line 7071 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7067,7 +7078,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7104,21 +7115,34 @@ fi
       echo "$ac_t""no" 1>&6
       { echo "configure: error: the specified tree doesn't have a52.h" 1>&2; exit 1; }
     fi
-  else     for ac_hdr in a52dec/a52.h
+  else
+    if test "x${with_a52}" = "x"
+    then
+      test_LDFLAGS=""
+      test_CFLAGS=""
+    else
+      test_LDFLAGS="-L${with_a52}/lib"
+      test_CFLAGS="-I${with_a52}/include"
+    fi
+    save_CPPFLAGS="${CPPFLAGS}"
+    save_LDFLAGS="${LDFLAGS}"
+    CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
+    LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
+    for ac_hdr in a52dec/a52.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7112: checking for $ac_hdr" >&5
+echo "configure:7136: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7117 "configure"
+#line 7141 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7140,7 +7164,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:7144: checking for a52_free in -la52" >&5
+echo "configure:7168: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7148,7 +7172,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7152 "configure"
+#line 7176 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7159,7 +7183,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7176,11 +7200,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
         BUILTINS="${BUILTINS} codec/a52/a52"
-        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
-        a52_CFLAGS="${a52_CFLAGS}"
+        a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
       
 else
   echo "$ac_t""no" 1>&6
+
+        if test "x${enable_dvbpsi}" != "x"
+        then
+          { echo "configure: error: Could not find a52 on your system: you may get it from http://liba52.sf.net" 1>&2; exit 1; }
+        fi
+      
 fi
 
     
@@ -7189,6 +7219,8 @@ else
 fi
 done
 
+    CPPFLAGS="${save_CPPFLAGS}"
+    LDFLAGS="${save_LDFLAGS}"
   fi
 fi
 
@@ -7215,17 +7247,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7219: checking for $ac_hdr" >&5
+echo "configure:7251: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7224 "configure"
+#line 7256 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7268,17 +7300,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7272: checking for $ac_hdr" >&5
+echo "configure:7304: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7277 "configure"
+#line 7309 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7330,17 +7362,17 @@ if test "x${enable_x11}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7334: checking for $ac_hdr" >&5
+echo "configure:7366: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7339 "configure"
+#line 7371 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7386,17 +7418,17 @@ if test "x${enable_xvideo}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7390: checking for $ac_hdr" >&5
+echo "configure:7422: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7395 "configure"
+#line 7427 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7419,7 +7451,7 @@ EOF
  
     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
     echo $ac_n "checking for XvPutImage in -lXv_pic""... $ac_c" 1>&6
-echo "configure:7423: checking for XvPutImage in -lXv_pic" >&5
+echo "configure:7455: checking for XvPutImage in -lXv_pic" >&5
 ac_lib_var=`echo Xv_pic'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7427,7 +7459,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv_pic  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7431 "configure"
+#line 7463 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7438,7 +7470,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7460,7 +7492,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for XvPutImage in -lXv""... $ac_c" 1>&6
-echo "configure:7464: checking for XvPutImage in -lXv" >&5
+echo "configure:7496: checking for XvPutImage in -lXv" >&5
 ac_lib_var=`echo Xv'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7468,7 +7500,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7472 "configure"
+#line 7504 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7479,7 +7511,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7539,7 +7571,7 @@ fi
   # Extract the first word of "sdl12-config", so it can be a program name with args.
 set dummy sdl12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7543: checking for $ac_word" >&5
+echo "configure:7575: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7579,7 +7611,7 @@ fi
     # Extract the first word of "sdl11-config", so it can be a program name with args.
 set dummy sdl11-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7583: checking for $ac_word" >&5
+echo "configure:7615: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7620,7 +7652,7 @@ fi
     # Extract the first word of "sdl-config", so it can be a program name with args.
 set dummy sdl-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7624: checking for $ac_word" >&5
+echo "configure:7656: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7665,17 +7697,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7669: checking for $ac_hdr" >&5
+echo "configure:7701: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+#line 7706 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7745,17 +7777,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7749: checking for $ac_hdr" >&5
+echo "configure:7781: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7754 "configure"
+#line 7786 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7784,7 +7816,7 @@ done
 
     else
       echo $ac_n "checking for directX headers in ${with_directx}""... $ac_c" 1>&6
-echo "configure:7788: checking for directX headers in ${with_directx}" >&5
+echo "configure:7820: checking for directX headers in ${with_directx}" >&5
       if test -f ${with_directx}/ddraw.h
       then
         PLUGINS="${PLUGINS} video_output/directx/directx"
@@ -7811,17 +7843,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7815: checking for $ac_hdr" >&5
+echo "configure:7847: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7820 "configure"
+#line 7852 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7916,17 +7948,17 @@ if test "x${enable_aa}" = "xyes"
 then
   ac_safe=`echo "aalib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for aalib.h""... $ac_c" 1>&6
-echo "configure:7920: checking for aalib.h" >&5
+echo "configure:7952: checking for aalib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7925 "configure"
+#line 7957 "configure"
 #include "confdefs.h"
 #include <aalib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7963,31 +7995,31 @@ if test "${with_+set}" = set; then
 fi
 
 
-# Check whether --enable-dsp or --disable-dsp was given.
-if test "${enable_dsp+set}" = set; then
-  enableval="$enable_dsp"
+# Check whether --enable-oss or --disable-oss was given.
+if test "${enable_oss+set}" = set; then
+  enableval="$enable_oss"
   :
 fi
 
 
-if test "x${enable_dsp}" != "xno" &&
-  (test "x${SYS}" != "xmingw32" || test "x${enable_dsp}" = "xyes")
+if test "x${enable_oss}" != "xno" &&
+  (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
 then
   for ac_hdr in soundcard.h sys/soundcard.h machine/soundcard.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7981: checking for $ac_hdr" >&5
+echo "configure:8013: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7986 "configure"
+#line 8018 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8008,9 +8040,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-    PLUGINS="${PLUGINS} audio_output/dsp/dsp"
+    #PLUGINS="${PLUGINS} audio_output/oss"
     echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:8014: checking for main in -lossaudio" >&5
+echo "configure:8046: checking for main in -lossaudio" >&5
 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8018,14 +8050,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lossaudio  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8022 "configure"
+#line 8054 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:8029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8061,7 +8093,7 @@ if test "${enable_esd+set}" = set; then
      # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8065: checking for $ac_word" >&5
+echo "configure:8097: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8096,7 +8128,7 @@ fi
 
      if test "x${ESD_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} audio_output/esd/esd"
+       #PLUGINS="${PLUGINS} audio_output/esd"
        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
      fi
@@ -8112,7 +8144,7 @@ if test "${enable_arts+set}" = set; then
      # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8116: checking for $ac_word" >&5
+echo "configure:8148: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8147,7 +8179,7 @@ fi
 
      if test "x${ARTS_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} audio_output/arts/arts"
+       #PLUGINS="${PLUGINS} audio_output/arts"
        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
      fi
@@ -8162,17 +8194,17 @@ if test "${enable_alsa+set}" = set; then
    then
      ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:8166: checking for alsa/asoundlib.h" >&5
+echo "configure:8198: checking for alsa/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8171 "configure"
+#line 8203 "configure"
 #include "confdefs.h"
 #include <alsa/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8189,7 +8221,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:8193: checking for main in -lasound" >&5
+echo "configure:8225: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8197,14 +8229,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8201 "configure"
+#line 8233 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:8208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8232,7 +8264,7 @@ fi
 
      if test "x${have_alsa}" = "xtrue"
      then
-       PLUGINS="${PLUGINS} audio_output/alsa/alsa"
+       #PLUGINS="${PLUGINS} audio_output/alsa"
        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
      fi
    fi
@@ -8247,7 +8279,7 @@ fi
 
 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
   then
-    PLUGINS="${PLUGINS} audio_output/waveout/waveout"
+    #PLUGINS="${PLUGINS} audio_output/waveout"
     waveout_LDFLAGS="-lwinmm"
 fi
 
@@ -8286,7 +8318,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8290: checking for $ac_word" >&5
+echo "configure:8322: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8325,7 +8357,7 @@ fi
     # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8329: checking for $ac_word" >&5
+echo "configure:8361: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8374,17 +8406,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8378: checking for $ac_hdr" >&5
+echo "configure:8410: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8383 "configure"
+#line 8415 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8444,7 +8476,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8448: checking for $ac_word" >&5
+echo "configure:8480: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8483,7 +8515,7 @@ fi
     # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8487: checking for $ac_word" >&5
+echo "configure:8519: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8532,17 +8564,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8536: checking for $ac_hdr" >&5
+echo "configure:8568: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8541 "configure"
+#line 8573 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8587,7 +8619,7 @@ if test "${enable_gnome+set}" = set; then
     # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8591: checking for $ac_word" >&5
+echo "configure:8623: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8631,17 +8663,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8635: checking for $ac_hdr" >&5
+echo "configure:8667: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8640 "configure"
+#line 8672 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8728,17 +8760,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8732: checking for $ac_hdr" >&5
+echo "configure:8764: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8737 "configure"
+#line 8769 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8781,17 +8813,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8785: checking for $ac_hdr" >&5
+echo "configure:8817: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8790 "configure"
+#line 8822 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8862,17 +8894,17 @@ if test "x${enable_xosd}" = "xyes"
 then
   ac_safe=`echo "xosd.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for xosd.h""... $ac_c" 1>&6
-echo "configure:8866: checking for xosd.h" >&5
+echo "configure:8898: checking for xosd.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8871 "configure"
+#line 8903 "configure"
 #include "confdefs.h"
 #include <xosd.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8911,17 +8943,17 @@ if test "x${enable_lirc}" = "xyes"
 then
   ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6
-echo "configure:8915: checking for lirc/lirc_client.h" >&5
+echo "configure:8947: checking for lirc/lirc_client.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8920 "configure"
+#line 8952 "configure"
 #include "confdefs.h"
 #include <lirc/lirc_client.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8938,7 +8970,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:8942: checking for lirc_init in -llirc_client" >&5
+echo "configure:8974: checking for lirc_init in -llirc_client" >&5
 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8946,7 +8978,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llirc_client  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8950 "configure"
+#line 8982 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8957,7 +8989,7 @@ int main() {
 lirc_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9012,7 +9044,7 @@ fi
       ;;
     *)
                   echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6
-echo "configure:9016: checking whether the byte order is big-endian" >&5
+echo "configure:9048: checking whether the byte order is big-endian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9094,7 +9126,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test "x${enable_pth}" = "xyes"; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:9098: checking for pth_init in -lpth" >&5
+echo "configure:9130: checking for pth_init in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9102,7 +9134,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9106 "configure"
+#line 9138 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9113,7 +9145,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9141,7 +9173,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9145 "configure"
+#line 9177 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -9167,7 +9199,7 @@ if test "${enable_st+set}" = set; then
   enableval="$enable_st"
    if test "x${enable_st}" = "xyes"; then
     echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6
-echo "configure:9171: checking for st_init in -lst" >&5
+echo "configure:9203: checking for st_init in -lst" >&5
 ac_lib_var=`echo st'_'st_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9175,7 +9207,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lst  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9179 "configure"
+#line 9211 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9186,7 +9218,7 @@ int main() {
 st_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9214,7 +9246,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9218 "configure"
+#line 9250 "configure"
 #include "confdefs.h"
 #include <st.h>
 EOF
@@ -9250,7 +9282,7 @@ then
   # Extract the first word of "mozilla-config", so it can be a program name with args.
 set dummy mozilla-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9254: checking for $ac_word" >&5
+echo "configure:9286: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MOZILLA_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9288,7 +9320,7 @@ fi
     if test "x${SYS}" != "xmingw32"; then
       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
       echo $ac_n "checking for XtStrings in -lXt""... $ac_c" 1>&6
-echo "configure:9292: checking for XtStrings in -lXt" >&5
+echo "configure:9324: checking for XtStrings in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtStrings | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9296,7 +9328,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9300 "configure"
+#line 9332 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9307,7 +9339,7 @@ int main() {
 XtStrings()
 ; return 0; }
 EOF
-if { (eval echo configure:9311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
index eb4c651eeabd2f27daed4c1bee9f6fafaad8740c..e60ebcbeb35c52bbcdf87c3ad41d78b488d7cc9a 100644 (file)
@@ -437,9 +437,12 @@ BUILTINS="${BUILTINS}"
 PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
-PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/mpeg_video/mpeg_video codec/lpcm/lpcm codec/spdif/spdif codec/spudec/spudec"
+PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec"
+#PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/lpcm/lpcm codec/spdif/spdif"
 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
-PLUGINS="${PLUGINS} visualization/scope/scope"
+PLUGINS="${PLUGINS} audio_mixer/trivial"
+PLUGINS="${PLUGINS} audio_output/file"
+#PLUGINS="${PLUGINS} visualization/scope/scope"
 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
 
 dnl
@@ -808,7 +811,7 @@ then
     fi
   ;;
   xno)
-    dnl  Compile without dvbpsi (dlopen version, works only under Linux)
+    dnl  Compile without dvbpsi
   ;;
   *)
     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
@@ -963,7 +966,7 @@ then
       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
       AC_CHECK_LIB(mad, mad_bit_init, [
-        BUILTINS="${BUILTINS} codec/mad/mad"
+        #BUILTINS="${BUILTINS} codec/mad/mad"
         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
       ],[])
@@ -978,7 +981,7 @@ then
     AC_CHECK_HEADERS(mad.h, ,
       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
     AC_CHECK_LIB(mad, mad_bit_init, [
-      PLUGINS="${PLUGINS} codec/mad/mad"
+      #PLUGINS="${PLUGINS} codec/mad/mad"
       mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
     CFLAGS="${save_CFLAGS}"
@@ -1067,9 +1070,11 @@ dnl
 dnl  a52 AC3 decoder plugin
 dnl
 AC_ARG_ENABLE(a52,
-  [  --enable-a52            AC3 support with liba52 (default enabled)])
+  [  --enable-a52            A/52 support with liba52 (default enabled)])
 if test "x${enable_a52}" != "xno"
 then
+  AC_ARG_WITH(a52, 
+    [    --with-a52=PATH       a52 headers and libraries])
   AC_ARG_WITH(a52-tree,
     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
   if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
@@ -1106,14 +1111,33 @@ then
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([the specified tree doesn't have a52.h])
     fi
-  else dnl  no with args
+  else
+    if test "x${with_a52}" = "x"
+    then
+      test_LDFLAGS=""
+      test_CFLAGS=""
+    else
+      test_LDFLAGS="-L${with_a52}/lib"
+      test_CFLAGS="-I${with_a52}/include"
+    fi
+    save_CPPFLAGS="${CPPFLAGS}"
+    save_LDFLAGS="${LDFLAGS}"
+    CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
+    LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
     AC_CHECK_HEADERS(a52dec/a52.h, [
       AC_CHECK_LIB(a52, a52_free, [
         BUILTINS="${BUILTINS} codec/a52/a52"
-        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
-        a52_CFLAGS="${a52_CFLAGS}"
-      ],[],[-lm])
+        a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
+      ],[
+        if test "x${enable_dvbpsi}" != "x"
+        then
+          AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
+        fi
+      ],[-lm])
     ])
+    CPPFLAGS="${save_CPPFLAGS}"
+    LDFLAGS="${save_LDFLAGS}"
   fi
 fi
 
@@ -1377,14 +1401,14 @@ AC_ARG_WITH(,[Audio plugins:])
 dnl
 dnl  OSS /dev/dsp module (enabled by default except on win32)
 dnl
-AC_ARG_ENABLE(dsp,
-  [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])
+AC_ARG_ENABLE(oss,
+  [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
 
-if test "x${enable_dsp}" != "xno" &&
-  (test "x${SYS}" != "xmingw32" || test "x${enable_dsp}" = "xyes")
+if test "x${enable_oss}" != "xno" &&
+  (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
 then
   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
-    PLUGINS="${PLUGINS} audio_output/dsp/dsp"
+    #PLUGINS="${PLUGINS} audio_output/oss"
     AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
   ])
 fi
@@ -1399,7 +1423,7 @@ AC_ARG_ENABLE(esd,
      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
      if test "x${ESD_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} audio_output/esd/esd"
+       #PLUGINS="${PLUGINS} audio_output/esd"
        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
      fi
@@ -1415,7 +1439,7 @@ AC_ARG_ENABLE(arts,
      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
      if test "x${ARTS_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} audio_output/arts/arts"
+       #PLUGINS="${PLUGINS} audio_output/arts"
        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
      fi
@@ -1431,7 +1455,7 @@ AC_ARG_ENABLE(alsa,
      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
      if test "x${have_alsa}" = "xtrue"
      then
-       PLUGINS="${PLUGINS} audio_output/alsa/alsa"
+       #PLUGINS="${PLUGINS} audio_output/alsa"
        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
      fi
    fi])
@@ -1443,7 +1467,7 @@ AC_ARG_ENABLE(waveout,
   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
   then
-    PLUGINS="${PLUGINS} audio_output/waveout/waveout"
+    #PLUGINS="${PLUGINS} audio_output/waveout"
     waveout_LDFLAGS="-lwinmm"
 fi
 
diff --git a/include/aout_internal.h b/include/aout_internal.h
new file mode 100644 (file)
index 0000000..0f4e974
--- /dev/null
@@ -0,0 +1,266 @@
+/*****************************************************************************
+ * aout_internal.h : internal defines for audio output
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: aout_internal.h,v 1.1 2002/08/07 21:36:55 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * aout_alloc_t : allocation of memory in the audio output
+ *****************************************************************************/
+typedef struct aout_alloc_t
+{
+    int                     i_alloc_type;
+    int                     i_bytes_per_sec; /* -1 if only the alloc_type is
+                                              * relevant. */
+} aout_alloc_t;
+
+#define AOUT_ALLOC_NONE     0
+#define AOUT_ALLOC_STACK    1
+#define AOUT_ALLOC_HEAP     2
+
+#define aout_BufferAlloc( p_alloc, i_nb_usec, p_previous_buffer, p_new_buffer ) \
+    if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_NONE )                       \
+    {                                                                       \
+        (p_new_buffer) = p_previous_buffer;                                 \
+    }                                                                       \
+    else                                                                    \
+    {                                                                       \
+        if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_STACK )                  \
+        {                                                                   \
+            (p_new_buffer) = alloca( (u64)(p_alloc)->i_bytes_per_sec        \
+                                 * i_nb_usec                                \
+                                 / 1000000 + 1 + sizeof(aout_buffer_t) );   \
+        }                                                                   \
+        else                                                                \
+        {                                                                   \
+            (p_new_buffer) = malloc( (u64)(p_alloc)->i_bytes_per_sec        \
+                                 * i_nb_usec                                \
+                                 / 1000000 + 1 + sizeof(aout_buffer_t) );   \
+        }                                                                   \
+        (p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type;             \
+        (p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec            \
+                                        * i_nb_usec / 1000000 + 1;          \
+        (p_new_buffer)->p_buffer = (void *)(p_new_buffer)                   \
+                                     + sizeof(aout_buffer_t);               \
+        if ( (p_previous_buffer) != NULL )                                  \
+        {                                                                   \
+            (p_new_buffer)->start_date =                                    \
+                        ((aout_buffer_t *)p_previous_buffer)->start_date;   \
+            (p_new_buffer)->end_date =                                      \
+                        ((aout_buffer_t *)p_previous_buffer)->end_date;     \
+        }                                                                   \
+    }
+
+#define aout_BufferFree( p_buffer )                                         \
+    if ( (p_buffer)->i_alloc_type == AOUT_ALLOC_HEAP )                      \
+    {                                                                       \
+        free( p_buffer );                                                   \
+    }
+
+/*****************************************************************************
+ * aout_fifo_t : audio output buffer FIFO
+ *****************************************************************************/
+typedef struct aout_fifo_t
+{
+    vlc_mutex_t             lock;
+    struct aout_buffer_t *  p_first;
+    struct aout_buffer_t ** pp_last;
+} aout_fifo_t;
+
+static inline void aout_FifoInit( struct aout_instance_t * p_aout,
+                                  aout_fifo_t * p_fifo )
+{
+    vlc_mutex_init( (vlc_object_t *)p_aout, &p_fifo->lock );
+    p_fifo->p_first = NULL;
+    p_fifo->pp_last = &p_fifo->p_first;
+}
+
+static inline void aout_FifoPush( struct aout_instance_t * p_aout,
+                                  aout_fifo_t * p_fifo,
+                                  aout_buffer_t * p_buffer )
+{
+    vlc_mutex_lock( &p_fifo->lock );
+    *p_fifo->pp_last = p_buffer;
+    p_fifo->pp_last = &p_buffer->p_next;
+    *p_fifo->pp_last = NULL;
+    vlc_mutex_unlock( &p_fifo->lock );
+}
+
+/* This function supposes there is one buffer in p_fifo. */
+static inline aout_buffer_t * aout_FifoPop( struct aout_instance_t * p_aout,
+                                            aout_fifo_t * p_fifo )
+{
+    aout_buffer_t * p_buffer;
+    vlc_mutex_lock( &p_fifo->lock );
+    p_buffer = p_fifo->p_first;
+    p_fifo->p_first = p_buffer->p_next;
+    if ( p_fifo->p_first == NULL )
+    {
+        p_fifo->pp_last = &p_fifo->p_first;
+    }
+    vlc_mutex_unlock( &p_fifo->lock );
+
+    return p_buffer;
+}
+
+static inline void aout_FifoDestroy( struct aout_instance_t * p_aout,
+                                     aout_fifo_t * p_fifo )
+{
+    aout_buffer_t * p_buffer;
+
+    vlc_mutex_destroy( &p_fifo->lock );
+    p_buffer = p_fifo->p_first;
+    while ( p_buffer != NULL )
+    {
+        aout_buffer_t * p_next = p_buffer->p_next;
+        aout_BufferFree( p_buffer );
+        p_buffer = p_next;
+    }
+}
+
+/*****************************************************************************
+ * aout_filter_t : audio output filter
+ *****************************************************************************/
+typedef struct aout_filter_t
+{
+    VLC_COMMON_MEMBERS
+
+    audio_sample_format_t   input;
+    audio_sample_format_t   output;
+    aout_alloc_t            output_alloc;
+
+    module_t *              p_module;
+    struct aout_filter_sys_t * p_sys;
+    void                 (* pf_do_work)( struct aout_instance_t *,
+                                         struct aout_filter_t *,
+                                         struct aout_buffer_t *,
+                                         struct aout_buffer_t * );
+    vlc_bool_t              b_in_place;
+} aout_filter_t;
+
+/*****************************************************************************
+ * aout_mixer_t : audio output mixer
+ *****************************************************************************/
+typedef struct aout_mixer_t
+{
+    audio_sample_format_t   input;
+    audio_sample_format_t   output;
+    aout_alloc_t            output_alloc;
+
+    module_t *              p_module;
+    struct aout_mixer_sys_t * p_sys;
+    void                 (* pf_do_work)( struct aout_instance_t *,
+                                         struct aout_buffer_t * );
+} aout_mixer_t;
+
+/*****************************************************************************
+ * aout_input_t : input stream for the audio output
+ *****************************************************************************/
+struct aout_input_t
+{
+    audio_sample_format_t   input;
+    aout_alloc_t            input_alloc;
+
+    /* pre-filters */
+    aout_filter_t *         pp_filters[AOUT_MAX_FILTERS];
+    int                     i_nb_filters;
+
+    aout_fifo_t             fifo;
+
+    char *                  p_first_byte_to_mix;
+};
+
+/*****************************************************************************
+ * aout_output_t : output stream for the audio output
+ *****************************************************************************/
+typedef struct aout_output_t
+{
+    audio_sample_format_t   output;
+
+    /* post-filters */
+    aout_filter_t *         pp_filters[AOUT_MAX_FILTERS];
+    int                     i_nb_filters;
+
+    aout_fifo_t             fifo;
+    mtime_t                 last_date;
+
+    struct module_t *       p_module;
+    struct aout_sys_t *     p_sys;
+    int                  (* pf_setformat)( aout_instance_t * );
+    void                 (* pf_play)( aout_instance_t *, aout_buffer_t * );
+    int                     i_nb_samples;
+} aout_output_t;
+
+/*****************************************************************************
+ * aout_instance_t : audio output thread descriptor
+ *****************************************************************************/
+struct aout_instance_t
+{
+    VLC_COMMON_MEMBERS
+
+    /* Input streams & pre-filters */
+    vlc_mutex_t             input_lock;
+    vlc_cond_t              input_signal;
+    int                     i_inputs_active;
+    vlc_bool_t              b_change_requested;
+    aout_input_t *          pp_inputs[AOUT_MAX_INPUTS];
+    int                     i_nb_inputs;
+
+    /* Mixer */
+    vlc_mutex_t             mixer_lock;
+    vlc_cond_t              mixer_signal;
+    vlc_bool_t              b_mixer_active;
+    aout_mixer_t            mixer;
+
+    /* Output plug-in */
+    aout_output_t           output;
+};
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+void aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
+                     aout_buffer_t * p_buffer );
+
+int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
+                                aout_filter_t ** pp_filters,
+                                int * pi_nb_filters,
+                                audio_sample_format_t * p_input_format,
+                                audio_sample_format_t * p_output_format );
+void aout_FiltersDestroyPipeline( aout_instance_t * p_aout,
+                                  aout_filter_t ** pp_filters,
+                                  int i_nb_filters );
+void aout_FiltersHintBuffers( aout_instance_t * p_aout,
+                              aout_filter_t ** pp_filters,
+                              int i_nb_filters, aout_alloc_t * p_first_alloc );
+void aout_FiltersPlay( aout_instance_t * p_aout,
+                       aout_filter_t ** pp_filters,
+                       int i_nb_filters, aout_buffer_t ** pp_input_buffer );
+
+int aout_MixerNew( aout_instance_t * p_aout );
+void aout_MixerDelete( aout_instance_t * p_aout );
+void aout_MixerRun( aout_instance_t * p_aout );
+
+int aout_OutputNew( aout_instance_t * p_aout,
+                    audio_sample_format_t * p_format );
+void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer );
+void aout_OutputDelete( aout_instance_t * p_aout );
+
+int aout_FormatToBytes( audio_sample_format_t * p_format );
index 6257e4f16ed6a543d333389dca81b5c6469a7dfe..27779a3079a93073724b8de2a1523c6ac8db391f 100644 (file)
@@ -1,11 +1,10 @@
 /*****************************************************************************
- * audio_output.h : audio output thread interface
+ * audio_output.h : audio output interface
  *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.51 2002/08/04 17:23:41 sam Exp $
+ * Copyright (C) 2002 VideoLAN
+ * $Id: audio_output.h,v 1.52 2002/08/07 21:36:55 massiot Exp $
  *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Cyril Deguet <asmax@via.ecp.fr>
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *****************************************************************************/
 
 /*****************************************************************************
- * aout_increment_t
+ * audio_sample_format_t
  *****************************************************************************
- * This structure is used to keep the progression of an index up-to-date, in
- * order to avoid rounding problems and heavy computations, as the function
- * that handles this structure only uses additions.
+ * This structure defines a format for audio samples.
  *****************************************************************************/
-typedef struct aout_increment_t
+struct audio_sample_format_t
 {
-    /* The remainder is used to keep track of the fractional part of the
-     * index. */
-    int i_r;
-
-    /*
-     * The increment structure is initialized with the result of an euclidean
-     * division :
-     *
-     *  i_x           i_b
-     * ----- = i_a + -----
-     *  i_y           i_c
-     *
-     */
-    int i_a, i_b, i_c;
-
-} aout_increment_t;
-
-/*****************************************************************************
- * aout_fifo_t
- *****************************************************************************/
-struct aout_fifo_t
-{
-    /* See the fifo formats below */
     int                 i_format;
-    int                 i_channels;
     int                 i_rate;
-    int                 i_frame_size;
-
-    vlc_bool_t          b_die;
-    int                 i_fifo;      /* Just to keep track of the fifo index */
-
-    vlc_mutex_t         data_lock;
-    vlc_cond_t          data_wait;
-
-    u8 *                buffer;
-    mtime_t *           date;
-
-    /* The start frame is the first frame in the buffer that contains decoded
-     * audio data. It it also the first frame in the current timestamped frame
-     * area, ie the first dated frame in the decoded part of the buffer. :-p */
-    int                 i_start_frame;
-    vlc_bool_t          b_start_frame;
-    /* The next frame is the end frame of the current timestamped frame area,
-     * ie the first dated frame after the start frame. */
-    int                 i_next_frame;
-    vlc_bool_t          b_next_frame;
-    /* The end frame is the first frame, after the start frame, that doesn't
-     * contain decoded audio data. That's why the end frame is the first frame
-     * where the audio decoder can store its decoded audio frames. */
-    int                 i_end_frame;
-
-    /* Current index in p_aout->buffer */
-    int                 i_unit;
-    /* Max index in p_aout->buffer */
-    int                 i_unit_limit;
-    /* Structure used to calculate i_unit with a Bresenham algorithm */
-    aout_increment_t    unit_increment;
-
-    /* The following variable is used to store the number of remaining audio
-     * units in the current timestamped frame area. */
-    int                 i_units;
-};
-
-#define AOUT_FIFO_ISEMPTY( fifo ) \
-  ( (fifo).i_end_frame == (fifo).i_start_frame )
-
-#define AOUT_FIFO_ISFULL( fifo ) \
-  ( ((((fifo).i_end_frame + 1) - (fifo).i_start_frame) & AOUT_FIFO_SIZE) == 0 )
-
-#define AOUT_FIFO_INC( i_index ) \
-  ( ((i_index) + 1) & AOUT_FIFO_SIZE )
-
-/* List of known fifo formats */
-#define AOUT_FIFO_NONE    0
-#define AOUT_FIFO_PCM     1
-#define AOUT_FIFO_SPDIF   2
-
-/*****************************************************************************
- * aout_thread_t : audio output thread descriptor
- *****************************************************************************/
-struct aout_thread_t
-{
-    VLC_COMMON_MEMBERS
-
-    vlc_mutex_t         fifos_lock;
-    aout_fifo_t         fifo[ AOUT_MAX_FIFOS ];
-
-    /* Plugin used and shortcuts to access its capabilities */
-    module_t *   p_module;
-    int       ( *pf_setformat )  ( aout_thread_t * );
-    int       ( *pf_getbufinfo ) ( aout_thread_t * , int );
-    void      ( *pf_play )       ( aout_thread_t * , byte_t *, int );
-
-    void *              buffer;
-    /* The s32 buffer is used to mix all the audio fifos together before
-     * converting them and storing them in the audio output buffer */
-    s32 *               s32_buffer;
-
-    /* The size of the audio output buffer is kept in audio units, as this is
-     * the only unit that is common with every audio decoder and audio fifo */
-    int                 i_units;
-
-    /* date is the moment where the first audio unit of the output buffer
-     * will be played */
-    mtime_t             date;
-
-    /* The current volume */
-    int                 i_volume;
-    int                 i_savedvolume;
-
-    /* Format of the audio output samples, number of channels, and
-     * rate and gain (in Hz) of the audio output sound */
-    int                 i_format;
     int                 i_channels;
-    int                 i_rate;
-
-    /* Latency of the audio output plugin, in bytes */
-    int                 i_latency;
-
-    /* there might be some useful private structure, such as audio_buf_info
-     * for the OSS output */
-    aout_sys_t *        p_sys;
 };
 
-/* Those are from <linux/soundcard.h> but are needed because of formats
- * on other platforms */
-#define AOUT_FMT_U8          0x00000008
-#define AOUT_FMT_S16_LE      0x00000010           /* Little endian signed 16 */
-#define AOUT_FMT_S16_BE      0x00000020              /* Big endian signed 16 */
-#define AOUT_FMT_S8          0x00000040
-#define AOUT_FMT_U16_LE      0x00000080                 /* Little endian U16 */
-#define AOUT_FMT_U16_BE      0x00000100                    /* Big endian U16 */
-#define AOUT_FMT_A52         0x00000400                 /* Dolby Digital A52 */
+#define AOUT_FMT_MU_LAW     0x00000001
+#define AOUT_FMT_A_LAW      0x00000002
+#define AOUT_FMT_IMA_ADPCM  0x00000004
+#define AOUT_FMT_U8         0x00000008
+#define AOUT_FMT_S16_LE     0x00000010            /* Little endian signed 16 */
+#define AOUT_FMT_S16_BE     0x00000020               /* Big endian signed 16 */
+#define AOUT_FMT_S8         0x00000040
+#define AOUT_FMT_U16_LE     0x00000080                  /* Little endian U16 */
+#define AOUT_FMT_U16_BE     0x00000100                     /* Big endian U16 */
+#define AOUT_FMT_A52        0x00000400             /* ATSC A/52 (for SP/DIF) */
+#define AOUT_FMT_FLOAT32    0x00000800
+#define AOUT_FMT_FIXED32    0x00001000
+
+#define AOUT_FMTS_IDENTICAL( p_first, p_second ) (                          \
+    (p_first->i_format == p_second->i_format)                               \
+      && (p_first->i_rate == p_second->i_rate)                              \
+      && (p_first->i_channels == p_second->i_channels                       \
+           || p_first->i_channels == -1 || p_second->i_channels == -1) )
 
 #ifdef WORDS_BIGENDIAN
-#define AOUT_FMT_S16_NE      AOUT_FMT_S16_BE
+#   define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
+#   define AOUT_FMT_U16_NE AOUT_FMT_U16_BE
 #else
-#define AOUT_FMT_S16_NE      AOUT_FMT_S16_LE
+#   define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
+#   define AOUT_FMT_U16_NE AOUT_FMT_U16_LE
 #endif
 
-/* Number of samples in an A52 frame */
-#define A52_FRAME_SIZE      1536
+/*****************************************************************************
+ * aout_buffer_t : audio output buffer
+ *****************************************************************************/
+struct aout_buffer_t
+{
+    char *                  p_buffer;
+    int                     i_alloc_type;
+    size_t                  i_size;
+    int                     i_nb_samples;
+    mtime_t                 start_date, end_date;
 
-/* Size of a frame for spdif output */
-#define SPDIF_FRAME_SIZE    6144
+    struct aout_buffer_t *  p_next;
+};
 
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-aout_thread_t * aout_CreateThread       ( vlc_object_t *, int, int );
-void            aout_DestroyThread      ( aout_thread_t * );
-
-#define aout_CreateFifo(a,b,c,d,e,f) __aout_CreateFifo(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( aout_fifo_t *, __aout_CreateFifo,  ( vlc_object_t *, int, int, int, int, void * ) );
-VLC_EXPORT( void,            aout_DestroyFifo, ( aout_fifo_t *p_fifo ) );
-            void             aout_FreeFifo     ( aout_fifo_t *p_fifo );
+/* From audio_output.c : */
+#define aout_NewInstance(a) __aout_NewInstance(VLC_OBJECT(a))
+VLC_EXPORT( aout_instance_t *, __aout_NewInstance,    ( vlc_object_t * ) );
+VLC_EXPORT( void,              aout_DeleteInstance, ( aout_instance_t * ) );
+VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) );
+VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
+VLC_EXPORT( void, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
+
+/* From input.c : */
+#define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c)
+VLC_EXPORT( aout_input_t *, __aout_InputNew, ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) );
+VLC_EXPORT( void, aout_InputDelete, ( aout_instance_t *, aout_input_t * ) );
+
+/* From output.c : */
+VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t ) );
 
index e90ddd42e7739a770fac2bbf854f73f8bbe03967..471dccde40117db75a836f455447701c978d8112 100644 (file)
 #define VOLUME_MAX                      1024
 #define VOLUME_MIN                      0
 
-/* Number of audio output frames contained in an audio output fifo.
- * (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the
- * %(AOUT_FIFO_SIZE + 1) operation with an &AOUT_FIFO_SIZE.
- * With 255 we have at least 255*384/2/48000=1 second of sound */
-#define AOUT_FIFO_SIZE                  255
-
-/* Maximum number of audio fifos. The value of AOUT_MAX_FIFOS should be a power
- * of two, in order to optimize the '/AOUT_MAX_FIFOS' and '*AOUT_MAX_FIFOS'
- * operations with '>>' and '<<' (gcc changes this at compilation-time) */
-#define AOUT_MAX_FIFOS                  2
-
-/* Duration (in microseconds) of an audio output buffer should be :
- * - short, in order to be able to play a new song very quickly (especially a
- *   song from the interface)
- * - long, in order to perform the buffer calculations as few as possible */
-#define AOUT_BUFFER_DURATION            90000
+/* Max number of pre-filters per input, and max-number of post-filters */
+#define AOUT_MAX_FILTERS                10
+
+/* Max number of inputs */
+#define AOUT_MAX_INPUTS                 5
 
 /*****************************************************************************
  * Video configuration
index 17bf78f6fec94a94c86fdeccdd8df1077c85b59c..7b55f68ef639da85e0dfa7b3a26670c233bf7474 100644 (file)
-/* include/defs.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
+/* include/defs.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define if using alloca.c.  */
-#undef C_ALLOCA
+/* Maximum supported data alignment */
+#undef ATTRIBUTE_ALIGNED_MAX
 
-/* Define to empty if the keyword does not work.  */
-#undef const
+/* Define if $CC groks 3D Now! inline assembly. */
+#undef CAN_COMPILE_3DNOW
+
+/* Define if $CC groks AltiVec inline assembly. */
+#undef CAN_COMPILE_ALTIVEC
+
+/* Define if your compiler groks C AltiVec extensions. */
+#undef CAN_COMPILE_C_ALTIVEC
+
+/* Define if $CC groks SSE inline assembly. */
+#undef CAN_COMPILE_SSE
+
+/* The ./configure command line */
+#undef CONFIGURE_LINE
+
+/* Copyright string */
+#undef COPYRIGHT_MESSAGE
 
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
 #undef CRAY_STACKSEG_END
 
-/* Define if you have alloca, as a function or macro.  */
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
+#undef DPMSINFO_IN_DPMS_H
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if you have the <a52dec/a52.h> header file. */
+#undef HAVE_A52DEC_A52_H
+
+/* Define to 1 if you have `alloca', as a function or macro. */
 #undef HAVE_ALLOCA
 
-/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
 #undef HAVE_ALLOCA_H
 
-/* Define if you have a working `mmap' system call.  */
-#undef HAVE_MMAP
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
 
-/* Define as __inline if that's what the C compiler calls it.  */
-#undef inline
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
 
-/* Define to `long' if <sys/types.h> doesn't define.  */
-#undef off_t
+/* Define to 1 if you have the `atoll' function. */
+#undef HAVE_ATOLL
 
-/* Define as the return type of signal handlers (int or void).  */
-#undef RETSIGTYPE
+/* Define to 1 if you have the <Cocoa/Cocoa.h> header file. */
+#undef HAVE_COCOA_COCOA_H
 
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
+/* Define to 1 if you have the <cthreads.h> header file. */
+#undef HAVE_CTHREADS_H
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
+/* Define to 1 if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
 
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
+/* Define to 1 if you have the <ddraw.h> header file. */
+#undef HAVE_DDRAW_H
 
-/* Define if you can safely include both <sys/time.h> and <time.h>.  */
-#undef TIME_WITH_SYS_TIME
+/* Define if <time.h> defines nanosleep. */
+#undef HAVE_DECL_NANOSLEEP
 
-/* Define if you have the __argz_count function.  */
-#undef HAVE___ARGZ_COUNT
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
 
-/* Define if you have the __argz_next function.  */
-#undef HAVE___ARGZ_NEXT
+/* Define to 1 if you have the <dvbpsi/dr.h> header file. */
+#undef HAVE_DVBPSI_DR_H
 
-/* Define if you have the __argz_stringify function.  */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if you have the <dvdcss/dvdcss.h> header file. */
+#undef HAVE_DVDCSS_DVDCSS_H
 
-/* Define if you have the atoll function.  */
-#undef HAVE_ATOLL
+/* Define to 1 if you have the <dvdplay/dvdplay.h> header file. */
+#undef HAVE_DVDPLAY_DVDPLAY_H
 
-/* Define if you have the dcgettext function.  */
-#undef HAVE_DCGETTEXT
+/* Define to 1 if you have the <dvdread/dvd_reader.h> header file. */
+#undef HAVE_DVDREAD_DVD_READER_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
 
-/* Define if you have the feof_unlocked function.  */
+/* Define to 1 if you have the `feof_unlocked' function. */
 #undef HAVE_FEOF_UNLOCKED
 
-/* Define if you have the fgets_unlocked function.  */
+/* Define to 1 if you have the `fgets_unlocked' function. */
 #undef HAVE_FGETS_UNLOCKED
 
-/* Define if you have the getcwd function.  */
+/* Define to 1 if you have the <gdk/gdk.h> header file. */
+#undef HAVE_GDK_GDK_H
+
+/* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
-/* Define if you have the getegid function.  */
+/* Define to 1 if you have the `getegid' function. */
 #undef HAVE_GETEGID
 
-/* Define if you have the geteuid function.  */
+/* Define to 1 if you have the `geteuid' function. */
 #undef HAVE_GETEUID
 
-/* Define if you have the getgid function.  */
+/* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
-/* Define if you have the gethostbyname2 function.  */
+/* Define to 1 if you have the `gethostbyname2' function. */
 #undef HAVE_GETHOSTBYNAME2
 
-/* Define if you have the getpagesize function.  */
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* getopt support */
+#undef HAVE_GETOPT_LONG
+
+/* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
-/* Define if you have the getpwuid function.  */
+/* Define to 1 if you have the `getpwuid' function. */
 #undef HAVE_GETPWUID
 
-/* Define if you have the gettimeofday function.  */
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
-/* Define if you have the getuid function.  */
+/* Define to 1 if you have the `getuid' function. */
 #undef HAVE_GETUID
 
-/* Define if you have the isatty function.  */
-#undef HAVE_ISATTY
-
-/* Define if you have the memalign function.  */
-#undef HAVE_MEMALIGN
-
-/* Define if you have the mempcpy function.  */
-#undef HAVE_MEMPCPY
-
-/* Define if you have the munmap function.  */
-#undef HAVE_MUNMAP
-
-/* Define if you have the posix_memalign function.  */
-#undef HAVE_POSIX_MEMALIGN
-
-/* Define if you have the putenv function.  */
-#undef HAVE_PUTENV
-
-/* Define if you have the select function.  */
-#undef HAVE_SELECT
-
-/* Define if you have the setenv function.  */
-#undef HAVE_SETENV
-
-/* Define if you have the setlocale function.  */
-#undef HAVE_SETLOCALE
-
-/* Define if you have the sigrelse function.  */
-#undef HAVE_SIGRELSE
+/* Define to 1 if you have the <glib.h> header file. */
+#undef HAVE_GLIB_H
 
-/* Define if you have the stpcpy function.  */
-#undef HAVE_STPCPY
+/* Define to 1 if you have the <gnome.h> header file. */
+#undef HAVE_GNOME_H
 
-/* Define if you have the strcasecmp function.  */
-#undef HAVE_STRCASECMP
+/* Define to 1 if you have the <gtk/gtk.h> header file. */
+#undef HAVE_GTK_GTK_H
 
-/* Define if you have the strchr function.  */
-#undef HAVE_STRCHR
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
 
-/* Define if you have the strdup function.  */
-#undef HAVE_STRDUP
+/* Define to 1 if you have the <image.h> header file. */
+#undef HAVE_IMAGE_H
 
-/* Define if you have the strerror function.  */
-#undef HAVE_STRERROR
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
 
-/* Define if you have the strndup function.  */
-#undef HAVE_STRNDUP
+/* For FreeBSD VCD support */
+#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
 
-/* Define if you have the strtod function.  */
-#undef HAVE_STRTOD
+/* Define to 1 if you have the `isatty' function. */
+#undef HAVE_ISATTY
 
-/* Define if you have the strtol function.  */
-#undef HAVE_STRTOL
+/* Define to 1 if you have the <kernel/OS.h> header file. */
+#undef HAVE_KERNEL_OS_H
 
-/* Define if you have the strtoul function.  */
-#undef HAVE_STRTOUL
+/* Define to 1 if you have the <kernel/scheduler.h> header file. */
+#undef HAVE_KERNEL_SCHEDULER_H
 
-/* Define if you have the swab function.  */
-#undef HAVE_SWAB
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
 
-/* Define if you have the tsearch function.  */
-#undef HAVE_TSEARCH
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
 
-/* Define if you have the vasprintf function.  */
-#undef HAVE_VASPRINTF
+/* Define to 1 if you have the <libdv/dv.h> header file. */
+#undef HAVE_LIBDV_DV_H
 
-/* Define if you have the <Cocoa/Cocoa.h> header file.  */
-#undef HAVE_COCOA_COCOA_H
+/* Define to 1 if you have the `pth' library (-lpth). */
+#undef HAVE_LIBPTH
 
-/* Define if you have the <Ph.h> header file.  */
-#undef HAVE_PH_H
+/* Define to 1 if you have the `st' library (-lst). */
+#undef HAVE_LIBST
 
-/* Define if you have the <X11/Xlib.h> header file.  */
-#undef HAVE_X11_XLIB_H
+/* Define to 1 if you have the <libv4l/v4l.h> header file. */
+#undef HAVE_LIBV4L_V4L_H
 
-/* Define if you have the <X11/extensions/Xv.h> header file.  */
-#undef HAVE_X11_EXTENSIONS_XV_H
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
 
-/* Define if you have the <X11/extensions/dpms.h> header file.  */
-#undef HAVE_X11_EXTENSIONS_DPMS_H
+/* Define to 1 if you have the <linux/fb.h> header file. */
+#undef HAVE_LINUX_FB_H
 
-/* Define if you have the <a52dec/a52.h> header file.  */
-#undef HAVE_A52DEC_A52_H
+/* Define to 1 if you have the <linux/version.h> header file. */
+#undef HAVE_LINUX_VERSION_H
 
-/* Define if you have the <argz.h> header file.  */
-#undef HAVE_ARGZ_H
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
 
-/* Define if you have the <arpa/inet.h> header file.  */
-#undef HAVE_ARPA_INET_H
+/* Define to 1 if you have the <machine/param.h> header file. */
+#undef HAVE_MACHINE_PARAM_H
 
-/* Define if you have the <cthreads.h> header file.  */
-#undef HAVE_CTHREADS_H
+/* Define to 1 if you have the <machine/soundcard.h> header file. */
+#undef HAVE_MACHINE_SOUNDCARD_H
 
-/* Define if you have the <ddraw.h> header file.  */
-#undef HAVE_DDRAW_H
+/* Define to 1 if you have the <mad.h> header file. */
+#undef HAVE_MAD_H
 
-/* Define if you have the <dlfcn.h> header file.  */
-#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
 
-/* Define if you have the <dvbpsi/dr.h> header file.  */
-#undef HAVE_DVBPSI_DR_H
+/* Define to 1 if you have the `memalign' function. */
+#undef HAVE_MEMALIGN
 
-/* Define if you have the <dvdcss/dvdcss.h> header file.  */
-#undef HAVE_DVDCSS_DVDCSS_H
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
 
-/* Define if you have the <dvdplay/dvdplay.h> header file.  */
-#undef HAVE_DVDPLAY_DVDPLAY_H
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
 
-/* Define if you have the <dvdread/dvd_reader.h> header file.  */
-#undef HAVE_DVDREAD_DVD_READER_H
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
 
-/* Define if you have the <fcntl.h> header file.  */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
 
-/* Define if you have the <gdk/gdk.h> header file.  */
-#undef HAVE_GDK_GDK_H
+/* Define if nanosleep is available. */
+#undef HAVE_NANOSLEEP
 
-/* Define if you have the <getopt.h> header file.  */
-#undef HAVE_GETOPT_H
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
 
-/* Define if you have the <glib.h> header file.  */
-#undef HAVE_GLIB_H
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
 
-/* Define if you have the <gnome.h> header file.  */
-#undef HAVE_GNOME_H
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
 
-/* Define if you have the <gtk/gtk.h> header file.  */
-#undef HAVE_GTK_GTK_H
+/* Define to 1 if you have the <ogg/ogg.h> header file. */
+#undef HAVE_OGG_OGG_H
 
-/* Define if you have the <image.h> header file.  */
-#undef HAVE_IMAGE_H
+/* Define to 1 if you have the <Ph.h> header file. */
+#undef HAVE_PH_H
 
-/* Define if you have the <inttypes.h> header file.  */
-#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `posix_memalign' function. */
+#undef HAVE_POSIX_MEMALIGN
 
-/* Define if you have the <kernel/OS.h> header file.  */
-#undef HAVE_KERNEL_OS_H
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
 
-/* Define if you have the <kernel/scheduler.h> header file.  */
-#undef HAVE_KERNEL_SCHEDULER_H
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
 
-/* Define if you have the <libdv/dv.h> header file.  */
-#undef HAVE_LIBDV_DV_H
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
 
-/* Define if you have the <libv4l/v4l.h> header file.  */
-#undef HAVE_LIBV4L_V4L_H
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
 
-/* Define if you have the <limits.h> header file.  */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
 
-/* Define if you have the <linux/fb.h> header file.  */
-#undef HAVE_LINUX_FB_H
+/* Define to 1 if you have the `sigrelse' function. */
+#undef HAVE_SIGRELSE
 
-/* Define if you have the <linux/version.h> header file.  */
-#undef HAVE_LINUX_VERSION_H
+/* Define to 1 if you have the <soundcard.h> header file. */
+#undef HAVE_SOUNDCARD_H
 
-/* Define if you have the <locale.h> header file.  */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
 
-/* Define if you have the <machine/param.h> header file.  */
-#undef HAVE_MACHINE_PARAM_H
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
 
-/* Define if you have the <machine/soundcard.h> header file.  */
-#undef HAVE_MACHINE_SOUNDCARD_H
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
 
-/* Define if you have the <mad.h> header file.  */
-#undef HAVE_MAD_H
+/* Define to 1 if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
 
-/* Define if you have the <malloc.h> header file.  */
-#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
 
-/* Define if you have the <net/if.h> header file.  */
-#undef HAVE_NET_IF_H
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
 
-/* Define if you have the <netinet/in.h> header file.  */
-#undef HAVE_NETINET_IN_H
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
 
-/* Define if you have the <nl_types.h> header file.  */
-#undef HAVE_NL_TYPES_H
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
 
-/* Define if you have the <ogg/ogg.h> header file.  */
-#undef HAVE_OGG_OGG_H
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
 
-/* Define if you have the <pthread.h> header file.  */
-#undef HAVE_PTHREAD_H
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
 
-/* Define if you have the <soundcard.h> header file.  */
-#undef HAVE_SOUNDCARD_H
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
 
-/* Define if you have the <stddef.h> header file.  */
-#undef HAVE_STDDEF_H
+/* Define to 1 if you have the `strtod' function. */
+#undef HAVE_STRTOD
 
-/* Define if you have the <stdint.h> header file.  */
-#undef HAVE_STDINT_H
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
 
-/* Define if you have the <stdlib.h> header file.  */
-#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
 
-/* Define if you have the <string.h> header file.  */
-#undef HAVE_STRING_H
+/* Define if <sys/time.h> defines struct timespec. */
+#undef HAVE_STRUCT_TIMESPEC
 
-/* Define if you have the <strings.h> header file.  */
-#undef HAVE_STRINGS_H
+/* Define to 1 if you have the `swab' function. */
+#undef HAVE_SWAB
 
-/* Define if you have the <sys/int_types.h> header file.  */
+/* Define to 1 if you have the <sys/int_types.h> header file. */
 #undef HAVE_SYS_INT_TYPES_H
 
-/* Define if you have the <sys/param.h> header file.  */
+/* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
-/* Define if you have the <sys/shm.h> header file.  */
+/* Define to 1 if you have the <sys/shm.h> header file. */
 #undef HAVE_SYS_SHM_H
 
-/* Define if you have the <sys/socket.h> header file.  */
+/* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
-/* Define if you have the <sys/sockio.h> header file.  */
+/* Define to 1 if you have the <sys/sockio.h> header file. */
 #undef HAVE_SYS_SOCKIO_H
 
-/* Define if you have the <sys/soundcard.h> header file.  */
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
 #undef HAVE_SYS_SOUNDCARD_H
 
-/* Define if you have the <sys/time.h> header file.  */
-#undef HAVE_SYS_TIME_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
 
-/* Define if you have the <sys/times.h> header file.  */
+/* Define to 1 if you have the <sys/times.h> header file. */
 #undef HAVE_SYS_TIMES_H
 
-/* Define if you have the <sys/types.h> header file.  */
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-/* Define if you have the <unistd.h> header file.  */
+/* Define to 1 if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
+
+/* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define if you have the pth library (-lpth).  */
-#undef HAVE_LIBPTH
+/* Support for variadic macros */
+#undef HAVE_VARIADIC_MACROS
 
-/* Define if you have the st library (-lst).  */
-#undef HAVE_LIBST
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
 
-/* Package name */
-#undef VLC_PACKAGE
+/* Define to 1 if you have the <X11/extensions/dpms.h> header file. */
+#undef HAVE_X11_EXTENSIONS_DPMS_H
 
-/* Package version */
-#undef VLC_VERSION
+/* Define to 1 if you have the <X11/extensions/Xv.h> header file. */
+#undef HAVE_X11_EXTENSIONS_XV_H
 
-/* Define if you have the iconv() function. */
-#undef HAVE_ICONV
+/* Define to 1 if you have the <X11/Xlib.h> header file. */
+#undef HAVE_X11_XLIB_H
+
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
 
 /* Define as const if the declaration of iconv() needs const. */
 #undef ICONV_CONST
 
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
+/* String suffix for module functions */
+#undef MODULE_SUFFIX
 
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
+/* Symbol suffix for module functions */
+#undef MODULE_SYMBOL
 
-/* Define to 1 if translation of program messages to the user's native language
-   is requested. */
-#undef ENABLE_NLS
+/* Define if <sys/param.h> defines ntohl. */
+#undef NTOHL_IN_SYS_PARAM_H
 
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#undef HAVE_GETTEXT
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
 
-/* Define if nanosleep is available. */
-#undef HAVE_NANOSLEEP
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
 
-/* long getopt support */
-#undef HAVE_GETOPT_LONG
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
 
-/* getopt support */
-#undef HAVE_GETOPT_LONG
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
 
 /* Define if <pthread.h> defines pthread_cond_t. */
 #undef PTHREAD_COND_T_IN_PTHREAD_H
 /* Define if <pthread.h> defines pthread_once. */
 #undef PTHREAD_ONCE_IN_PTHREAD_H
 
-/* Define if <strings.h> defines strncasecmp. */
-#undef STRNCASECMP_IN_STRINGS_H
-
-/* Define if <time.h> defines nanosleep. */
-#undef HAVE_DECL_NANOSLEEP
-
-/* Define if <sys/time.h> defines struct timespec. */
-#undef HAVE_STRUCT_TIMESPEC
-
-/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
-#undef DPMSINFO_IN_DPMS_H
-
-/* Define if <sys/param.h> defines ntohl. */
-#undef NTOHL_IN_SYS_PARAM_H
-
-/* Support for variadic macros */
-#undef HAVE_VARIADIC_MACROS
-
-/* Maximum supported data alignment */
-#undef ATTRIBUTE_ALIGNED_MAX
-
-/* Define if $CC groks 3D Now! inline assembly. */
-#undef CAN_COMPILE_3DNOW
-
-/* Define if $CC groks SSE inline assembly. */
-#undef CAN_COMPILE_SSE
-
-/* Define if $CC groks AltiVec inline assembly. */
-#undef CAN_COMPILE_ALTIVEC
-
-/* Define if your compiler groks C AltiVec extensions. */
-#undef CAN_COMPILE_C_ALTIVEC
+/* Define if <pth.h> defines pth_init */
+#undef PTH_INIT_IN_PTH_H
 
-/* For FreeBSD VCD support */
-#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
 
 /* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */
 #undef SDL_INCLUDE_FILE
 
-/* big endian system */
-#undef WORDS_BIGENDIAN
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
 
-/* Define if <pth.h> defines pth_init */
-#undef PTH_INIT_IN_PTH_H
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if <strings.h> defines strncasecmp. */
+#undef STRNCASECMP_IN_STRINGS_H
 
 /* Define if <st.h> defines st_init */
 #undef ST_INIT_IN_ST_H
 
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
 /* Simple version string */
 #undef VERSION_MESSAGE
 
-/* Copyright string */
-#undef COPYRIGHT_MESSAGE
+/* Package name */
+#undef VLC_PACKAGE
 
-/* The ./configure command line */
-#undef CONFIGURE_LINE
+/* Package version */
+#undef VLC_VERSION
 
-/* String suffix for module functions */
-#undef MODULE_SUFFIX
+/* big endian system */
+#undef WORDS_BIGENDIAN
 
-/* Symbol suffix for module functions */
-#undef MODULE_SYMBOL
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
 
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
index f4f1f1d416719ae2b4a6f35c36ac3bb818f634c1..78ffca901c791f89e2db56c87ab62d2afadf3c3d 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.14 2002/08/07 00:29:36 sam Exp $
+ * $Id: vlc_common.h,v 1.15 2002/08/07 21:36:55 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -173,9 +173,10 @@ VLC_DECLARE_STRUCT(stream_descriptor_t)
 VLC_DECLARE_STRUCT(stream_sys_t)
 
 /* Audio */
-VLC_DECLARE_STRUCT(aout_thread_t)
-VLC_DECLARE_STRUCT(aout_sys_t)
-VLC_DECLARE_STRUCT(aout_fifo_t)
+VLC_DECLARE_STRUCT(aout_instance_t)
+VLC_DECLARE_STRUCT(aout_input_t)
+VLC_DECLARE_STRUCT(aout_buffer_t)
+VLC_DECLARE_STRUCT(audio_sample_format_t)
 
 /* Video */
 VLC_DECLARE_STRUCT(vout_thread_t)
index d6770843cf71223ee991bc2ddec6d0def74ef194..b83948e87482eda7b8406db39bb4e46e2d13c0b2 100644 (file)
@@ -2,7 +2,10 @@
 
 struct module_symbols_t
 {
-    aout_fifo_t * (* __aout_CreateFifo_inner) ( vlc_object_t *, int, int, int, int, void * ) ;
+    aout_buffer_t * (* aout_BufferNew_inner) ( aout_instance_t *, aout_input_t *, size_t ) ;
+    aout_buffer_t * (* aout_OutputNextBuffer_inner) ( aout_instance_t *, mtime_t ) ;
+    aout_input_t * (* __aout_InputNew_inner) ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ;
+    aout_instance_t * (* __aout_NewInstance_inner) ( vlc_object_t * ) ;
     char * (* __config_GetPsz_inner) (vlc_object_t *, const char *) ;
     char * (* config_GetHomeDir_inner) ( void ) ;
     char * (* input_OffsetToTime_inner) ( input_thread_t *, char *, off_t ) ;
@@ -95,7 +98,10 @@ struct module_symbols_t
     void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
     void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ;
     void (* __vlc_thread_ready_inner) ( vlc_object_t * ) ;
-    void (* aout_DestroyFifo_inner) ( aout_fifo_t *p_fifo ) ;
+    void (* aout_BufferDelete_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ;
+    void (* aout_BufferPlay_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ;
+    void (* aout_DeleteInstance_inner) ( aout_instance_t * ) ;
+    void (* aout_InputDelete_inner) ( aout_instance_t *, aout_input_t * ) ;
     void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
     void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ;
     void (* config_UnsetCallbacks_inner) ( module_config_t * ) ;
@@ -146,7 +152,8 @@ struct module_symbols_t
 #   define UnalignedGetBits p_symbols->UnalignedGetBits_inner
 #   define UnalignedRemoveBits p_symbols->UnalignedRemoveBits_inner
 #   define UnalignedShowBits p_symbols->UnalignedShowBits_inner
-#   define __aout_CreateFifo p_symbols->__aout_CreateFifo_inner
+#   define __aout_InputNew p_symbols->__aout_InputNew_inner
+#   define __aout_NewInstance p_symbols->__aout_NewInstance_inner
 #   define __config_GetFloat p_symbols->__config_GetFloat_inner
 #   define __config_GetInt p_symbols->__config_GetInt_inner
 #   define __config_GetPsz p_symbols->__config_GetPsz_inner
@@ -193,7 +200,12 @@ struct module_symbols_t
 #   define __vlc_threads_end p_symbols->__vlc_threads_end_inner
 #   define __vlc_threads_init p_symbols->__vlc_threads_init_inner
 #   define __vout_CreateThread p_symbols->__vout_CreateThread_inner
-#   define aout_DestroyFifo p_symbols->aout_DestroyFifo_inner
+#   define aout_BufferDelete p_symbols->aout_BufferDelete_inner
+#   define aout_BufferNew p_symbols->aout_BufferNew_inner
+#   define aout_BufferPlay p_symbols->aout_BufferPlay_inner
+#   define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner
+#   define aout_InputDelete p_symbols->aout_InputDelete_inner
+#   define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner
 #   define config_Duplicate p_symbols->config_Duplicate_inner
 #   define config_FindConfig p_symbols->config_FindConfig_inner
 #   define config_GetHomeDir p_symbols->config_GetHomeDir_inner
diff --git a/modules/audio_filter/Makefile b/modules/audio_filter/Makefile
new file mode 100644 (file)
index 0000000..8525aea
--- /dev/null
@@ -0,0 +1 @@
+float32tos16_SOURCES = float32tos16.c
diff --git a/modules/audio_filter/float32tos16.c b/modules/audio_filter/float32tos16.c
new file mode 100644 (file)
index 0000000..669fa68
--- /dev/null
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * float32tos16.c : trivial mixer plug-in (1 input, no downmixing)
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: float32tos16.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <errno.h>
+#include <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  Create    ( vlc_object_t * );
+
+static void DoWork    ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
+                        aout_buffer_t * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+    set_description( _("aout filter for float32->s16 conversion") );
+    set_capability( "audio filter", 1 );
+    set_callbacks( Create, NULL );
+vlc_module_end();
+
+/*****************************************************************************
+ * Create: allocate trivial mixer
+ *****************************************************************************
+ * This function allocates and initializes a Crop vout method.
+ *****************************************************************************/
+static int Create( vlc_object_t *p_this )
+{
+    aout_filter_t * p_filter = (aout_filter_t *)p_this;
+
+    if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
+          && p_filter->output.i_format != AOUT_FMT_S16_NE )
+    {
+        return -1;
+    }
+
+    if ( p_filter->input.i_rate != p_filter->output.i_rate
+          || p_filter->input.i_channels != p_filter->output.i_channels )
+    {
+        return -1;
+    }
+
+
+    p_filter->pf_do_work = DoWork;
+    p_filter->b_in_place = 1;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * DoWork: convert a buffer
+ *****************************************************************************/
+static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
+                    aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
+{
+    int i;
+    float * p_in = (float *)p_in_buf->p_buffer;
+    s16 * p_out = (s16 *)p_out_buf->p_buffer;
+
+    for ( i = 0; i < p_in_buf->i_nb_samples * p_filter->input.i_channels; i++ )
+    {
+        if ( *p_in >= 1.0 ) *p_out = 32767;
+        else if ( *p_in < -1.0 ) *p_out = -32768;
+        else *p_out = *p_in * 32768.0;
+        p_in++; p_out++;
+    }
+}
+
diff --git a/modules/audio_mixer/Makefile b/modules/audio_mixer/Makefile
new file mode 100644 (file)
index 0000000..b49f813
--- /dev/null
@@ -0,0 +1 @@
+trivial_SOURCES = trivial.c
diff --git a/modules/audio_mixer/trivial.c b/modules/audio_mixer/trivial.c
new file mode 100644 (file)
index 0000000..441f1f6
--- /dev/null
@@ -0,0 +1,206 @@
+/*****************************************************************************
+ * trivial.c : trivial mixer plug-in (1 input, no downmixing)
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: trivial.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <errno.h>
+#include <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  Create    ( vlc_object_t * );
+
+static void DoWork    ( aout_instance_t *, aout_buffer_t * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+    set_description( _("trivial aout mixer module") );
+    set_capability( "audio mixer", 1 );
+    add_shortcut( "trivial" );
+    set_callbacks( Create, NULL );
+vlc_module_end();
+
+/*****************************************************************************
+ * Create: allocate trivial mixer
+ *****************************************************************************
+ * This function allocates and initializes a Crop vout method.
+ *****************************************************************************/
+static int Create( vlc_object_t *p_this )
+{
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+
+    if ( p_aout->mixer.output.i_format != AOUT_FMT_FLOAT32
+          && p_aout->mixer.output.i_format != AOUT_FMT_FIXED32 )
+    {
+        return -1;
+    }
+
+    p_aout->mixer.pf_do_work = DoWork;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * SparseCopy: trivially downmix or upmix a buffer
+ *****************************************************************************/
+static void SparseCopy( u32 * p_dest, const u32 * p_src, size_t i_len,
+                        int i_output_stride, int i_input_stride )
+{
+    int i;
+    for ( i = 0; i < i_len; i++ )
+    {
+        int j;
+        for ( j = 0; j < i_output_stride; j++ )
+        {
+            p_dest[j] = p_src[j];
+        }
+        p_src += i_input_stride;
+        p_dest += i_output_stride;
+    }
+}
+
+/*****************************************************************************
+ * DoWork: mix a new output buffer
+ *****************************************************************************/
+static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
+{
+    aout_input_t * p_input = p_aout->pp_inputs[0];
+
+    if ( p_input->input.i_channels == p_aout->mixer.output.i_channels )
+    {
+        int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32)
+                          * p_input->input.i_channels;
+        char * p_in = (p_input->p_first_byte_to_mix == NULL) ?
+                      p_input->fifo.p_first->p_buffer :
+                      p_input->p_first_byte_to_mix;
+        char * p_out = p_buffer->p_buffer;
+
+        for ( ; ; )
+        {
+            ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
+                                           - p_in)
+                                           + p_input->fifo.p_first->i_nb_samples
+                                              * sizeof(u32)
+                                              * p_input->input.i_channels;
+
+            if ( i_available_bytes < i_nb_bytes )
+            {
+                aout_buffer_t * p_old_buffer;
+
+                if ( i_available_bytes > 0 )
+                    p_aout->p_vlc->pf_memcpy( p_out, p_in, i_available_bytes );
+                i_nb_bytes -= i_available_bytes;
+                p_out += i_available_bytes;
+
+                /* Next buffer */
+                p_old_buffer = aout_FifoPop( p_aout, &p_input->fifo );
+                aout_BufferFree( p_old_buffer );
+                if ( p_input->fifo.p_first == NULL )
+                {
+                    msg_Err( p_aout, "internal amix error" );
+                    return;
+                }
+                p_in = p_input->fifo.p_first->p_buffer;
+            }
+            else
+            {
+                p_aout->p_vlc->pf_memcpy( p_out, p_in, i_nb_bytes );
+                p_input->p_first_byte_to_mix = p_in + i_nb_bytes;
+                break;
+            }
+        }
+    }
+    else
+    {
+        /* Downmixing or upmixing. */
+        int i_nb_samples = p_buffer->i_nb_samples;
+        u32 * p_in = (p_input->p_first_byte_to_mix == NULL) ?
+                     (u32 *)p_input->fifo.p_first->p_buffer :
+                     (u32 *)p_input->p_first_byte_to_mix;
+        u32 * p_out = (u32 *)p_buffer->p_buffer;
+
+
+        if ( p_input->input.i_channels < p_aout->mixer.output.i_channels )
+        {
+            /* Zero out the destination buffer, to avoid static on unavailable
+             * channels. */
+            memset( p_buffer->p_buffer, 0,
+                    p_buffer->i_nb_samples * sizeof(u32)
+                     * p_aout->mixer.output.i_channels );
+        }
+
+        for ( ; ; )
+        {
+            ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
+                                           - (char *)p_in)
+                                           + p_input->fifo.p_first->i_nb_samples
+                                              * sizeof(u32)
+                                              * p_input->input.i_channels;
+            int i_available_samples = i_available_bytes
+                                       / p_input->input.i_channels
+                                       / sizeof(u32);
+
+            if ( i_available_samples < i_nb_samples )
+            {
+                aout_buffer_t * p_old_buffer;
+
+                if ( i_available_samples > 0 )
+                    SparseCopy( p_out, p_in, i_available_samples,
+                                p_aout->mixer.output.i_channels,
+                                p_input->input.i_channels );
+                i_nb_samples -= i_available_samples;
+                p_out += i_available_samples * p_aout->mixer.output.i_channels;
+
+                /* Next buffer */
+                p_old_buffer = aout_FifoPop( p_aout, &p_input->fifo );
+                aout_BufferFree( p_old_buffer );
+                if ( p_input->fifo.p_first == NULL )
+                {
+                    msg_Err( p_aout, "internal amix error" );
+                    return;
+                }
+                p_in = (u32 *)p_input->fifo.p_first->p_buffer;
+            }
+            else
+            {
+                SparseCopy( p_out, p_in, i_nb_samples,
+                            p_aout->mixer.output.i_channels,
+                            p_input->input.i_channels );
+                p_input->p_first_byte_to_mix = (char *)p_in
+                               + i_nb_samples * p_input->input.i_channels
+                                  * sizeof(u32);
+                break;
+            }
+        }
+    }
+}
+
diff --git a/modules/audio_output/Makefile b/modules/audio_output/Makefile
new file mode 100644 (file)
index 0000000..4b6650c
--- /dev/null
@@ -0,0 +1,6 @@
+alsa_SOURCES = alsa.c
+arts_SOURCES = arts.c
+esd_SOURCES = esd.c
+file_SOURCES = file.c
+oss_SOURCES = oss.c
+waveout_SOURCES = waveout.c
similarity index 99%
rename from modules/audio_output/alsa/alsa.c
rename to modules/audio_output/alsa.c
index 1b23d3d83ed0851c839a69a6284d92b3dc406a94..302a835f4fa351ae118da1291fb2820108c33df3 100644 (file)
@@ -2,7 +2,7 @@
  * alsa.c : alsa plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: alsa.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: alsa.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
  *
  * Authors: Henri Fallon <henri@videolan.org> - Original Author
  *          Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
diff --git a/modules/audio_output/alsa/Makefile b/modules/audio_output/alsa/Makefile
deleted file mode 100644 (file)
index bf4dfff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-alsa_SOURCES = alsa.c
diff --git a/modules/audio_output/arts/Makefile b/modules/audio_output/arts/Makefile
deleted file mode 100644 (file)
index ddd35a1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-arts_SOURCES = arts.c
diff --git a/modules/audio_output/dsp/Makefile b/modules/audio_output/dsp/Makefile
deleted file mode 100644 (file)
index 393faf0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dsp_SOURCES = dsp.c
similarity index 99%
rename from modules/audio_output/esd/esd.c
rename to modules/audio_output/esd.c
index fa8c008055166c57f6bb38ab43befd824fb97cdd..15ef25b61c47a144b6ff4c18bcb85db5487188ba 100644 (file)
@@ -2,7 +2,7 @@
  * esd.c : EsounD module
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: esd.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: esd.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
diff --git a/modules/audio_output/esd/.cvsignore b/modules/audio_output/esd/.cvsignore
deleted file mode 100644 (file)
index 435f39e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.dep
-*.lo
-*.o.*
-*.lo.*
diff --git a/modules/audio_output/esd/Makefile b/modules/audio_output/esd/Makefile
deleted file mode 100644 (file)
index b944324..0000000
+++ /dev/null
@@ -1 +0,0 @@
-esd_SOURCES = esd.c
diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c
new file mode 100644 (file)
index 0000000..0c985eb
--- /dev/null
@@ -0,0 +1,147 @@
+/*****************************************************************************
+ * file.c : audio output which writes the samples to a file
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: file.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <string.h>
+#include <stdlib.h>
+
+#include <vlc/vlc.h>
+#include <vlc/aout.h>
+
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * Local prototypes.
+ *****************************************************************************/
+static int     Open        ( vlc_object_t * );
+static void    Close       ( vlc_object_t * );
+static int     SetFormat   ( aout_instance_t * );
+static void    Play        ( aout_instance_t *, aout_buffer_t * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+#define FORMAT_TEXT N_("Output format")
+#define FORMAT_LONGTEXT N_("one of \"u8\", \"s8\", \"u16\", \"s16\"," \
+                           " \"u16_le\", \"s16_le\", \"u16_be\"," \
+                           " \"s16_be\", \"fixed32\", \"float32\" or \"spdif\"")
+
+static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
+                               "u16_be", "s16_be", "fixed32", "float32",
+                               "spdif", NULL };
+static int format_int[] = { AOUT_FMT_U8, AOUT_FMT_S8, AOUT_FMT_U16_NE,
+                            AOUT_FMT_S16_NE, AOUT_FMT_U16_LE, AOUT_FMT_S16_LE,
+                            AOUT_FMT_U16_BE, AOUT_FMT_S16_BE, AOUT_FMT_FIXED32,
+                            AOUT_FMT_FLOAT32, AOUT_FMT_A52 };
+
+#define PATH_TEXT N_("Path of the output file")
+#define PATH_LONGTEXT N_("By default samples.raw")
+
+vlc_module_begin();
+    add_category_hint( N_("Audio"), NULL );
+    add_string_from_list( "format", "s16", format_list, NULL,
+                          FORMAT_TEXT, FORMAT_LONGTEXT );
+    add_string( "path", "samples.raw", NULL, PATH_TEXT, PATH_LONGTEXT );
+    set_description( _("file output module") );
+    set_capability( "audio output", 0 );
+    add_shortcut( "file" );
+    set_callbacks( Open, Close );
+vlc_module_end();
+
+/*****************************************************************************
+ * Open: open a dummy audio device
+ *****************************************************************************/
+static int Open( vlc_object_t * p_this )
+{
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+    FILE * p_file;
+    char * psz_name = config_GetPsz( p_this, "path" );
+
+    (FILE *)p_aout->output.p_sys = p_file = fopen( psz_name, "wb" );
+    free( psz_name );
+    if ( p_file == NULL ) return -1;
+
+    p_aout->output.pf_setformat = SetFormat;
+    p_aout->output.pf_play = Play;
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * Close: close our file
+ *****************************************************************************/
+static void Close( vlc_object_t * p_this )
+{
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+
+    fclose( (FILE *)p_aout->output.p_sys );
+}
+
+/*****************************************************************************
+ * SetFormat: pretend to set the dsp output format
+ *****************************************************************************/
+static int SetFormat( aout_instance_t * p_aout )
+{
+    char * psz_format = config_GetPsz( p_aout, "format" );
+    char ** ppsz_compare = format_list;
+    int i = 0;
+
+    while ( *ppsz_compare != NULL )
+    {
+        if ( !strncmp( *ppsz_compare, psz_format, strlen(*ppsz_compare) ) )
+        {
+            break;
+        }
+        ppsz_compare++; i++;
+    }
+
+    if ( *ppsz_compare == NULL )
+    {
+        msg_Err( p_aout, "Cannot understand the format string (%s)",
+                 psz_format );
+        return -1;
+    }
+
+    p_aout->output.output.i_format = format_int[i];
+    p_aout->output.i_nb_samples = 2048;
+    return 0;
+}
+
+/*****************************************************************************
+ * Play: pretend to play a sound
+ *****************************************************************************/
+static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
+{
+    if( fwrite( p_buffer->p_buffer,
+                p_buffer->i_nb_samples
+                 * aout_FormatToBytes( &p_aout->output.output ), 1,
+                (FILE *)p_aout->output.p_sys ) != 1 )
+    {
+        msg_Err( p_aout, "write error (%s)", strerror(errno) );
+    }
+
+    aout_BufferFree( p_buffer );
+}
+
similarity index 53%
rename from modules/audio_output/dsp/dsp.c
rename to modules/audio_output/oss.c
index 069593d644577550eb77e1cce1679314b3647a8d..8d7302fdf950dd5d71d555db1cabdc462af5d096 100644 (file)
@@ -1,11 +1,12 @@
 /*****************************************************************************
- * dsp.c : OSS /dev/dsp module for vlc
+ * oss.c : OSS /dev/dsp module for vlc
  *****************************************************************************
- * Copyright (C) 2000-2001 VideoLAN
- * $Id: dsp.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * Copyright (C) 2000-2002 VideoLAN
+ * $Id: oss.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
+ *          Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <stdlib.h>                            /* calloc(), malloc(), free() */
 
 #include <vlc/vlc.h>
+
+#ifdef HAVE_ALLOCA_H
+#   include <alloca.h>
+#endif
+
 #include <vlc/aout.h>
+#include "aout_internal.h"
 
 /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED,
  * SNDCTL_DSP_GETOSPACE */
 #endif
 
 /*****************************************************************************
- * aout_sys_t: dsp audio output method descriptor
+ * aout_sys_t: OSS audio output method descriptor
  *****************************************************************************
  * This structure is part of the audio output thread descriptor.
  * It describes the dsp specific properties of an audio device.
  *****************************************************************************/
 struct aout_sys_t
 {
-    audio_buf_info        audio_buf;
-
-    /* Path to the audio output device */
-    char *                psz_device;
     int                   i_fd;
+    volatile vlc_bool_t   b_die;
 };
 
+#define DEFAULT_FRAME_SIZE 2048
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
 static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
 
-static int  SetFormat    ( aout_thread_t * );
-static int  GetBufInfo   ( aout_thread_t *, int );
-static void Play         ( aout_thread_t *, byte_t *, int );
+static int  SetFormat    ( aout_instance_t * );
+static void Play         ( aout_instance_t *, aout_buffer_t * );
+static int  OSSThread    ( aout_instance_t * );
 
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    add_category_hint( N_("Miscellaneous"), NULL );
+    add_category_hint( N_("Audio"), NULL );
     add_file( "dspdev", "/dev/dsp", NULL, N_("OSS dsp device"), NULL );
     set_description( _("Linux OSS /dev/dsp module") );
     set_capability( "audio output", 100 );
@@ -82,122 +88,163 @@ vlc_module_begin();
 vlc_module_end();
 
 /*****************************************************************************
- * Open: opens the audio device (the digital sound processor)
+ * Open: open the audio device (the digital sound processor)
  *****************************************************************************
  * This function opens the dsp as a usual non-blocking write-only file, and
  * modifies the p_aout->p_sys->i_fd with the file's descriptor.
  *****************************************************************************/
 static int Open( vlc_object_t *p_this )
 {
-    aout_thread_t *p_aout = (aout_thread_t *)p_this;
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+    struct aout_sys_t * p_sys;
+    char * psz_device;
 
     /* Allocate structure */
-    p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
-    if( p_aout->p_sys == NULL )
+    p_aout->output.p_sys = p_sys = malloc( sizeof( aout_sys_t ) );
+    if( p_sys == NULL )
     {
         msg_Err( p_aout, "out of memory" );
-        return( 1 );
+        return 1;
     }
 
     /* Initialize some variables */
-    if( !(p_aout->p_sys->psz_device = config_GetPsz( p_aout, "dspdev" )) )
+    if( (psz_device = config_GetPsz( p_aout, "dspdev" )) == NULL )
     {
-        msg_Err( p_aout, "don't know which audio device to open" );
+        msg_Err( p_aout, "no audio device given (maybe /dev/dsp ?)" );
         free( p_aout->p_sys );
-        return( -1 );
+        return -1;
     }
 
-    p_aout->pf_setformat = SetFormat;
-    p_aout->pf_getbufinfo = GetBufInfo;
-    p_aout->pf_play = Play;
-
     /* Open the sound device */
-    if( (p_aout->p_sys->i_fd = open( p_aout->p_sys->psz_device, O_WRONLY ))
-        < 0 )
+    if( (p_sys->i_fd = open( psz_device, O_WRONLY )) < 0 )
     {
         msg_Err( p_aout, "cannot open audio device (%s)",
-                          p_aout->p_sys->psz_device );
+                          psz_device );
+        free( psz_device );
+        free( p_sys );
+        return -1;
+    }
+    free( psz_device );
+
+    /* Create OSS thread and wait for its readiness. */
+    p_sys->b_die = 0;
+    if( vlc_thread_create( p_aout, "aout", OSSThread, VLC_TRUE ) )
+    {
+        msg_Err( p_input, "cannot create OSS thread (%s)", strerror(errno) );
         free( p_aout->p_sys->psz_device );
         free( p_aout->p_sys );
-        return( -1 );
+        return -1;
     }
 
-    return( 0 );
+    p_aout->pf_setformat = SetFormat;
+    p_aout->pf_play = Play;
+
+    return 0;
 }
 
 /*****************************************************************************
- * SetFormat: resets the dsp and sets its format
+ * SetFormat: reset the dsp and set its format
  *****************************************************************************
  * This functions resets the DSP device, tries to initialize the output
  * format with the value contained in the dsp structure, and if this value
  * could not be set, the default value returned by ioctl is set. It then
  * does the same for the stereo mode, and for the output rate.
  *****************************************************************************/
-static int SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_instance_t *p_aout )
 {
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
     int i_format;
     int i_rate;
     vlc_bool_t b_stereo;
 
     /* Reset the DSP device */
-    if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
+    if( ioctl( p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
     {
-        msg_Err( p_aout, "cannot reset audio device (%s)",
-                          p_aout->p_sys->psz_device );
-        return( -1 );
+        msg_Err( p_aout, "cannot reset OSS audio device" );
+        return -1;
     }
 
     /* Set the output format */
-    i_format = p_aout->i_format;
-    if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0 )
+    i_format = AOUT_FMT_S16_NE;
+    if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0
+         || i_format != AOUT_FMT_S16_NE )
     {
         msg_Err( p_aout, "cannot set audio output format (%i)",
-                          p_aout->i_format );
-        return( -1 );
+                          i_format );
+        return -1;
     }
+    p_aout->output.output.i_format = AOUT_FMT_S16_NE;
 
-    if( i_format != p_aout->i_format )
+    /* FIXME */
+    if ( p_aout->output.output.i_channels > 2 )
     {
-        msg_Warn( p_aout, "audio output format not supported (%i)",
-                              p_aout->i_format );
-        p_aout->i_format = i_format;
+        msg_Warn( p_aout, "only two channels are supported at the moment" );
+        /* Trigger downmixing */
+        p_aout->output.output.i_channels = 2;
     }
 
     /* Set the number of channels */
-    b_stereo = ( p_aout->i_channels >= 2 );
+    b_stereo = p_aout->output.output.i_channels - 1;
 
-    if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_STEREO, &b_stereo ) < 0 )
+    if( ioctl( p_sys->i_fd, SNDCTL_DSP_STEREO, &b_stereo ) < 0 )
     {
         msg_Err( p_aout, "cannot set number of audio channels (%i)",
-                          p_aout->i_channels );
-        return( -1 );
+                          p_aout->output.output.i_channels );
+        return -1;
     }
 
-    if( (1 + b_stereo) != p_aout->i_channels )
+    if ( b_stereo + 1 != p_aout->output.output.i_channels )
     {
-        msg_Warn( p_aout, "%i audio channels not supported",
-                           p_aout->i_channels );
-        p_aout->i_channels = 1 + b_stereo;
+        msg_Warn( p_aout, "driver forced up/downmixing %li->%li",
+                          p_aout->output.output.i_channels,
+                          b_stereo + 1 );
+        p_aout->output.output.i_channels = b_stereo + 1;
     }
 
     /* Set the output rate */
-    i_rate = p_aout->i_rate;
+    i_rate = p_aout->output.output.i_rate;
     if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SPEED, &i_rate ) < 0 )
     {
         msg_Err( p_aout, "cannot set audio output rate (%i)", p_aout->i_rate );
-        return( -1 );
+        return -1;
     }
 
-    if( i_rate != p_aout->i_rate )
+    if( i_rate != p_aout->output.output.i_rate )
     {
-        msg_Warn( p_aout, "audio output rate not supported (%li)",
-                          p_aout->i_rate );
-        p_aout->i_rate = i_rate;
+        msg_Warn( p_aout, "driver forced resampling %li->%li",
+                          p_aout->output.output.i_rate, i_rate );
+        p_aout->output.output.i_rate = i_rate;
     }
 
-    return( 0 );
+    p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * Play: queue a buffer for playing by OSSThread
+ *****************************************************************************/
+static void Play( aout_instance_t *p_aout, aout_buffer_t * p_buffer )
+{
+    aout_FifoPush( p_aout, &p_aout->output.fifo, p_buffer );
+}
+
+/*****************************************************************************
+ * Close: close the dsp audio device
+ *****************************************************************************/
+static void Close( vlc_object_t * p_this )
+{
+    aout_instance_t *p_aout = (aout_instance_t *)p_this;
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
+
+    p_sys->b_die = 1;
+    vlc_thread_join( p_aout );
+
+    close( p_aout->p_sys->i_fd );
+    free( p_aout->p_sys );
 }
 
+
 /*****************************************************************************
  * GetBufInfo: buffer status query
  *****************************************************************************
@@ -208,40 +255,64 @@ static int SetFormat( aout_thread_t *p_aout )
  * - int bytes : available space in bytes (includes partially used fragments)
  * Note! 'bytes' could be more than fragments*fragsize
  *****************************************************************************/
-static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_instance_t * p_aout )
 {
-    ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_GETOSPACE,
-           &p_aout->p_sys->audio_buf );
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
+    audio_buf_info audio_buf;
+
+    ioctl( p_sys->i_fd, SNDCTL_DSP_GETOSPACE, &audio_buf );
 
     /* returns the allocated space in bytes */
-    return ( (p_aout->p_sys->audio_buf.fragstotal
-                 * p_aout->p_sys->audio_buf.fragsize)
-            - p_aout->p_sys->audio_buf.bytes );
+    return ( (audio_buf.fragstotal * audio_buf.fragsize) - audio_buf.bytes );
 }
 
 /*****************************************************************************
- * Play: plays a sound samples buffer
- *****************************************************************************
- * This function writes a buffer of i_length bytes in the dsp
+ * OSSThread: asynchronous thread used to DMA the data to the device
  *****************************************************************************/
-static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static int OSSThread( aout_instance_t * p_aout )
 {
-    int i_tmp;
-    i_tmp = write( p_aout->p_sys->i_fd, buffer, i_size );
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
 
-    if( i_tmp < 0 )
+    while ( !p_sys->b_die )
     {
-        msg_Err( p_aout, "write failed (%s)", strerror(errno) );
-    }
-}
+        int i_bytes_per_sample = aout_FormatToBytes( &p_aout->output.output );
+        aout_buffer_t * p_buffer;
+        mtime_t next_date;
+        int i_tmp;
+        char * p_bytes;
 
-/*****************************************************************************
- * Close: closes the dsp audio device
- *****************************************************************************/
-static void Close( vlc_object_t *p_this )
-{
-    aout_thread_t *p_aout = (aout_thread_t *)p_this;
+        /* Get the presentation date of the next write() operation. It
+         * is equal to the current date + duration of buffered samples.
+         * Order is important here, since GetBufInfo is believed to take
+         * more time than mdate(). */
+        next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000
+                      / i_bytes_per_sample
+                      / p_aout->output.output.i_rate;
+        next_date += mdate();
 
-    close( p_aout->p_sys->i_fd );
-    free( p_aout->p_sys->psz_device );
+        p_buffer = aout_OutputNextBuffer( p_aout, next_date );
+
+        if ( p_buffer != NULL )
+        {
+            p_bytes = p_buffer->p_buffer;
+        }
+        else
+        {
+            p_bytes = alloca( DEFAULT_FRAME_SIZE * i_bytes_per_sample );
+            memset( p_bytes, 0, DEFAULT_FRAME_SIZE * i_bytes_per_sample );
+        }
+
+        i_tmp = write( p_sys->i_fd, p_bytes,
+                       DEFAULT_FRAME_SIZE * i_bytes_per_sample );
+
+        if( i_tmp < 0 )
+        {
+            msg_Err( p_aout, "write failed (%s)", strerror(errno) );
+        }
+
+        if ( p_buffer != NULL )
+        {
+            aout_BufferFree( p_buffer );
+        }
+    }
 }
similarity index 99%
rename from modules/audio_output/waveout/waveout.c
rename to modules/audio_output/waveout.c
index 5369675a822be5105cac853fdcbd2469ff4a863c..7d61fff0be3f8cee0f6b57051e64e563b338a80d 100644 (file)
@@ -2,7 +2,7 @@
  * waveout.c : Windows waveOut plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: waveout.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: waveout.c,v 1.1 2002/08/07 21:36:55 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
diff --git a/modules/audio_output/waveout/.cvsignore b/modules/audio_output/waveout/.cvsignore
deleted file mode 100644 (file)
index 435f39e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.dep
-*.lo
-*.o.*
-*.lo.*
diff --git a/modules/audio_output/waveout/Makefile b/modules/audio_output/waveout/Makefile
deleted file mode 100644 (file)
index ca29f24..0000000
+++ /dev/null
@@ -1 +0,0 @@
-waveout_SOURCES = waveout.c
index dbb917bed41af79f0bffe809993cad670c9d0fb3..d23c459ae3cdbea716c2b9cb6bae7726caf4e5d4 100644 (file)
@@ -3,10 +3,11 @@
  *   This plugin makes use of liba52 to decode A/52 audio
  *   (http://liba52.sf.net/).
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * Copyright (C) 2001, 2002 VideoLAN
+ * $Id: a52.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
+ *          Christophe Massiot <massiot@via.ecp.fr>
  *      
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #define A52DEC_FRAME_SIZE 1536 
 
-/*
- * Global lock for accessing liba52 functions.
- * Currently, liba52 isn't thread-safe. So to prevent two threads from
- * using liba52 at the same time, we have to set up a global lock.
- * I know static variables aren't a good idea in multi-threaded programs,
- * but believe me, this is the way to go.
- * --Meuuh 2002-07-19
- */
-static vlc_mutex_t a52_lock;
-static vlc_bool_t  b_liba52_initialized = 0;
-
 
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
 static int  OpenDecoder    ( vlc_object_t * );
 static int  RunDecoder     ( decoder_fifo_t * );
-static int  DecodeFrame    ( a52_adec_thread_t * );
-static int  InitThread     ( a52_adec_thread_t * );
-static void EndThread      ( a52_adec_thread_t * );
-
-static void               BitstreamCallback ( bit_stream_t *, vlc_bool_t );
-static void               float2s16_2       ( float *, int16_t * );
-static inline int16_t     convert   ( int32_t );
+static int  DecodeFrame    ( a52_thread_t *, u8 * );
+static int  InitThread     ( a52_thread_t *, decoder_fifo_t * );
+static void EndThread      ( a52_thread_t * );
 
 /*****************************************************************************
  * Module descriptor
@@ -116,208 +102,211 @@ static int OpenDecoder( vlc_object_t *p_this )
  *****************************************************************************/
 static int RunDecoder( decoder_fifo_t *p_fifo )
 {
-    a52_adec_thread_t *p_a52_adec;
+    a52_thread_t *p_a52;
 
     /* Allocate the memory needed to store the thread's structure */
-    p_a52_adec = (a52_adec_thread_t *)malloc( sizeof(a52_adec_thread_t) );
-    if (p_a52_adec == NULL)
+    p_a52 = (a52_thread_t *)malloc( sizeof(a52_thread_t) );
+    if( p_a52 == NULL )
     {
         msg_Err( p_fifo, "out of memory" );
         DecoderError( p_fifo );
-        return( -1 );
+        return -1;
     }
 
-    /* FIXME */
-    p_a52_adec->i_channels = 2;
-
-    /*
-     * Initialize the thread properties
-     */
-    p_a52_adec->p_aout_fifo = NULL;
-    p_a52_adec->p_fifo = p_fifo;
-
-    if( InitThread( p_a52_adec ) )
+    if( InitThread( p_a52, p_fifo ) )
     {
-        msg_Err( p_a52_adec->p_fifo, "could not initialize thread" );
+        msg_Err( p_a52->p_fifo, "could not initialize thread" );
         DecoderError( p_fifo );
-        free( p_a52_adec );
-        return( -1 );
+        free( p_a52 );
+        return -1;
     }
 
     /* liba52 decoder thread's main loop */
-    while( !p_a52_adec->p_fifo->b_die && !p_a52_adec->p_fifo->b_error )
+    while( !p_a52->p_fifo->b_die && !p_a52->p_fifo->b_error )
     {
-
-        /* look for sync word - should be 0x0b77 */
-        RealignBits(&p_a52_adec->bit_stream);
-        while( (ShowBits( &p_a52_adec->bit_stream, 16 ) ) != 0x0b77 && 
-               (!p_a52_adec->p_fifo->b_die) && (!p_a52_adec->p_fifo->b_error))
+        int i_frame_size, i_flags, i_rate, i_bit_rate;
+        mtime_t pts;
+        /* Temporary buffer to store the raw frame to be decoded */
+        u8  p_frame_buffer[3840];
+
+        /* Look for sync word - should be 0x0b77 */
+        RealignBits(&p_a52->bit_stream);
+        while( (ShowBits( &p_a52->bit_stream, 16 ) ) != 0x0b77 && 
+               (!p_a52->p_fifo->b_die) && (!p_a52->p_fifo->b_error))
         {
-            RemoveBits( &p_a52_adec->bit_stream, 8 );
+            RemoveBits( &p_a52->bit_stream, 8 );
         }
 
-        /* get a52 frame header */
-        GetChunk( &p_a52_adec->bit_stream, p_a52_adec->p_frame_buffer, 7 );
-        if( p_a52_adec->p_fifo->b_die ) break;
+        /* Get A/52 frame header */
+        GetChunk( &p_a52->bit_stream, p_frame_buffer, 7 );
+        if( p_a52->p_fifo->b_die ) break;
 
-        /* check if frame is valid and get frame info */
-        vlc_mutex_lock( &a52_lock );
-        p_a52_adec->frame_size = a52_syncinfo( p_a52_adec->p_frame_buffer,
-                                               &p_a52_adec->flags,
-                                               &p_a52_adec->sample_rate,
-                                               &p_a52_adec->bit_rate );
-        vlc_mutex_unlock( &a52_lock );
+        /* Check if frame is valid and get frame info */
+        i_frame_size = a52_syncinfo( p_frame_buffer, &i_flags, &i_rate,
+                                     &i_bit_rate );
 
-        if( !p_a52_adec->frame_size )
+        if( !i_frame_size )
         {
-            msg_Warn( p_a52_adec->p_fifo, "a52_syncinfo failed" );
+            msg_Warn( p_a52->p_fifo, "a52_syncinfo failed" );
             continue;
         }
 
-        if( DecodeFrame( p_a52_adec ) && !p_a52_adec->p_fifo->b_die )
+        if( (p_a52->p_aout_input != NULL) &&
+            ( (p_a52->output_format.i_rate != i_rate)
+               /* || (p_a52->output_format.i_channels != i_channels) */ ) )
         {
-            DecoderError( p_fifo );
-            free( p_a52_adec );
-            return( -1 );
+            /* Parameters changed - this should not happen. */
+            aout_InputDelete( p_a52->p_aout, p_a52->p_aout_input );
+            p_a52->p_aout_input = NULL;
         }
 
+        /* Creating the audio input if not created yet. */
+        if( p_a52->p_aout_input == NULL )
+        {
+            p_a52->output_format.i_rate = i_rate;
+            /* p_a52->output_format.i_channels = i_channels; */
+            p_a52->p_aout_input = aout_InputNew( p_a52->p_fifo,
+                                                 &p_a52->p_aout,
+                                                 &p_a52->output_format );
+
+            if ( p_a52->p_aout_input == NULL )
+            {
+                p_a52->p_fifo->b_error = 1;
+                break;
+            }
+        }
+
+        /* Set the Presentation Time Stamp */
+        CurrentPTS( &p_a52->bit_stream, &pts, NULL );
+        if ( pts != 0 )
+        {
+            p_a52->last_date = pts;
+        }
+
+        /* Get the complete frame */
+        GetChunk( &p_a52->bit_stream, p_frame_buffer + 7,
+                  i_frame_size - 7 );
+        if( p_a52->p_fifo->b_die ) break;
+
+        if( DecodeFrame( p_a52, p_frame_buffer ) )
+        {
+            p_a52->p_fifo->b_error = 1;
+            break;
+        }
     }
 
     /* If b_error is set, the decoder thread enters the error loop */
-    if( p_a52_adec->p_fifo->b_error )
+    if( p_a52->p_fifo->b_error )
     {
-        DecoderError( p_a52_adec->p_fifo );
+        DecoderError( p_a52->p_fifo );
     }
 
     /* End of the liba52 decoder thread */
-    EndThread( p_a52_adec );
+    EndThread( p_a52 );
 
-    return( 0 );
+    return 0;
 }
 
 /*****************************************************************************
  * InitThread: initialize data before entering main loop
  *****************************************************************************/
-static int InitThread( a52_adec_thread_t * p_a52_adec )
+static int InitThread( a52_thread_t * p_a52, decoder_fifo_t * p_fifo )
 {
-    /* Initialize the global lock */
-    vlc_mutex_lock( p_a52_adec->p_fifo->p_vlc->p_global_lock );
-    if ( !b_liba52_initialized )
-    {
-        vlc_mutex_init( p_a52_adec->p_fifo, &a52_lock );
-        b_liba52_initialized = 1;
-    }
-    vlc_mutex_unlock( p_a52_adec->p_fifo->p_vlc->p_global_lock );
+    /* Initialize the thread properties */
+    p_a52->p_aout = NULL;
+    p_a52->p_aout_input = NULL;
+    p_a52->p_fifo = p_fifo;
+    p_a52->output_format.i_format = AOUT_FMT_FLOAT32;
+    p_a52->output_format.i_channels = 2; /* FIXME ! */
+    p_a52->last_date = 0;
 
     /* Initialize liba52 */
-    vlc_mutex_lock( &a52_lock );
-    p_a52_adec->p_a52_state = a52_init( 0 );
-    vlc_mutex_unlock( &a52_lock );
-    if( p_a52_adec->p_a52_state == NULL )
+    p_a52->p_a52_state = a52_init( 0 );
+    if( p_a52->p_a52_state == NULL )
     {
-        msg_Err( p_a52_adec->p_fifo, "unable to initialize liba52" );
+        msg_Err( p_a52->p_fifo, "unable to initialize liba52" );
         return -1;
     }
 
-    p_a52_adec->b_dynrng = config_GetInt( p_a52_adec->p_fifo, "a52-dynrng" );
+    p_a52->b_dynrng = config_GetInt( p_a52->p_fifo, "a52-dynrng" );
 
     /* Init the BitStream */
-    InitBitstream( &p_a52_adec->bit_stream,
-                   p_a52_adec->p_fifo,
-                   BitstreamCallback, NULL );
+    InitBitstream( &p_a52->bit_stream, p_a52->p_fifo,
+                   NULL, NULL );
 
-    return( 0 );
+    return 0;
 }
 
 /*****************************************************************************
- * DecodeFrame: decodes an ATSC A/52 frame.
+ * Interleave: helper function to interleave channels
  *****************************************************************************/
-static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
+static void Interleave( float * p_out, float * p_in, int i_channels )
 {
-    sample_t sample_level = 1;
-    byte_t   *p_buffer;
-    int i;
-
-    if( ( p_a52_adec->p_aout_fifo != NULL ) &&
-        ( p_a52_adec->p_aout_fifo->i_rate != p_a52_adec->sample_rate ) )
-    {
-        /* Make sure the output thread leaves the NextFrame() function */
-        vlc_mutex_lock (&(p_a52_adec->p_aout_fifo->data_lock));
-        aout_DestroyFifo (p_a52_adec->p_aout_fifo);
-        vlc_cond_signal (&(p_a52_adec->p_aout_fifo->data_wait));
-        vlc_mutex_unlock (&(p_a52_adec->p_aout_fifo->data_lock));
-
-        p_a52_adec->p_aout_fifo = NULL;
-    }
+    int i, j;
 
-    /* Creating the audio output fifo if not created yet */
-    if( p_a52_adec->p_aout_fifo == NULL )
+    for ( j = 0; j < i_channels; j++ )
     {
-        p_a52_adec->p_aout_fifo = aout_CreateFifo( p_a52_adec->p_fifo,
-                                    AOUT_FIFO_PCM, p_a52_adec->i_channels,
-                                    p_a52_adec->sample_rate,
-                                    A52DEC_FRAME_SIZE * p_a52_adec->i_channels,
-                                    NULL );
-
-        if ( p_a52_adec->p_aout_fifo == NULL )
-        { 
-            return( -1 );
+        for ( i = 0; i < 256; i++ )
+        {
+            p_out[i * i_channels + j] = p_in[j * 256 + i];
         }
     }
+}
 
-    /* Set the Presentation Time Stamp */
-    CurrentPTS( &p_a52_adec->bit_stream,
-                &p_a52_adec->p_aout_fifo->date[
-                    p_a52_adec->p_aout_fifo->i_end_frame],
-                NULL );
+/*****************************************************************************
+ * DecodeFrame: decode an ATSC A/52 frame.
+ *****************************************************************************/
+static int DecodeFrame( a52_thread_t * p_a52, u8 * p_frame_buffer )
+{
+    sample_t        i_sample_level = 1;
+    aout_buffer_t * p_buffer;
+    int             i, i_flags;
+    int             i_bytes_per_block = 256 * p_a52->output_format.i_channels
+                      * sizeof(float);
 
-    if( !p_a52_adec->p_aout_fifo->date[
-            p_a52_adec->p_aout_fifo->i_end_frame] )
+    if( !p_a52->last_date )
     {
-        p_a52_adec->p_aout_fifo->date[
-            p_a52_adec->p_aout_fifo->i_end_frame] = LAST_MDATE;
+        /* We've just started the stream, wait for the first PTS. */
+        return 0;
     }
 
-
-
-    p_buffer = ((byte_t *)p_a52_adec->p_aout_fifo->buffer) +
-        ( p_a52_adec->p_aout_fifo->i_end_frame * A52DEC_FRAME_SIZE *
-          p_a52_adec->i_channels * sizeof(s16) );
+    p_buffer = aout_BufferNew( p_a52->p_aout, p_a52->p_aout_input,
+                               A52DEC_FRAME_SIZE );
+    if ( p_buffer == NULL ) return -1;
+    p_buffer->start_date = p_a52->last_date;
+    p_a52->last_date += (mtime_t)(A52DEC_FRAME_SIZE * 1000000)
+                          / p_a52->output_format.i_rate;
+    p_buffer->end_date = p_a52->last_date;
 
     /* FIXME */
-    p_a52_adec->flags = A52_STEREO | A52_ADJUST_LEVEL;
-
-    /* Get the complete frame */
-    GetChunk( &p_a52_adec->bit_stream, p_a52_adec->p_frame_buffer + 7,
-              p_a52_adec->frame_size - 7 );
-    if( p_a52_adec->p_fifo->b_die ) return( -1 );
+    i_flags = A52_STEREO | A52_ADJUST_LEVEL;
 
-    /* do the actual decoding now */
-    vlc_mutex_lock( &a52_lock );
-    a52_frame( p_a52_adec->p_a52_state, p_a52_adec->p_frame_buffer,
-               &p_a52_adec->flags, &sample_level, 384 );
+    /* Do the actual decoding now */
+    a52_frame( p_a52->p_a52_state, p_frame_buffer,
+               &i_flags, &i_sample_level, 0 );
 
-    if( !p_a52_adec->b_dynrng )
-        a52_dynrng( p_a52_adec->p_a52_state, NULL, NULL );
+    if( !p_a52->b_dynrng )
+    {
+        a52_dynrng( p_a52->p_a52_state, NULL, NULL );
+    }
 
-    for( i = 0; i < 6; i++ )
+    for ( i = 0; i < 6; i++ )
     {
-        if( a52_block( p_a52_adec->p_a52_state ) )
+        sample_t * p_samples;
+
+        if( a52_block( p_a52->p_a52_state ) )
         {
-            msg_Warn( p_a52_adec->p_fifo, "a52_block failed for block %i", i );
+            msg_Warn( p_a52->p_fifo, "a52_block failed for block %i", i );
         }
 
-        float2s16_2( a52_samples( p_a52_adec->p_a52_state ),
-                     ((int16_t *)p_buffer) + i * 256 * p_a52_adec->i_channels );
-    }
-    vlc_mutex_unlock( &a52_lock );
+        p_samples = a52_samples( p_a52->p_a52_state );
 
+        /* Interleave the *$£%ù samples */
+        Interleave( (float *)(p_buffer->p_buffer + i * i_bytes_per_block),
+                    p_samples, p_a52->output_format.i_channels );
+    }
 
-    vlc_mutex_lock( &p_a52_adec->p_aout_fifo->data_lock );
-    p_a52_adec->p_aout_fifo->i_end_frame = 
-      (p_a52_adec->p_aout_fifo->i_end_frame + 1) & AOUT_FIFO_SIZE;
-    vlc_cond_signal (&p_a52_adec->p_aout_fifo->data_wait);
-    vlc_mutex_unlock (&p_a52_adec->p_aout_fifo->data_lock);
+    aout_BufferPlay( p_a52->p_aout, p_a52->p_aout_input, p_buffer );
 
     return 0;
 }
@@ -325,62 +314,14 @@ static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
 /*****************************************************************************
  * EndThread : liba52 decoder thread destruction
  *****************************************************************************/
-static void EndThread (a52_adec_thread_t *p_a52_adec)
+static void EndThread (a52_thread_t *p_a52)
 {
-    /* If the audio output fifo was created, we destroy it */
-    if (p_a52_adec->p_aout_fifo != NULL)
+    if ( p_a52->p_aout_input != NULL )
     {
-        aout_DestroyFifo (p_a52_adec->p_aout_fifo);
-
-        /* Make sure the output thread leaves the NextFrame() function */
-        vlc_mutex_lock (&(p_a52_adec->p_aout_fifo->data_lock));
-        vlc_cond_signal (&(p_a52_adec->p_aout_fifo->data_wait));
-        vlc_mutex_unlock (&(p_a52_adec->p_aout_fifo->data_lock));
+        aout_InputDelete( p_a52->p_aout, p_a52->p_aout_input );
     }
 
-    vlc_mutex_lock( &a52_lock );
-    a52_free( p_a52_adec->p_a52_state );
-    vlc_mutex_unlock( &a52_lock );
-    free( p_a52_adec );
-
-}
-
-/*****************************************************************************
- * float2s16_2 : converts floats to ints using a trick based on the IEEE
- *               floating-point format
- *****************************************************************************/
-static inline int16_t convert (int32_t i)
-{
-    if (i > 0x43c07fff)
-        return 32767;
-    else if (i < 0x43bf8000)
-        return -32768;
-    else
-        return i - 0x43c00000;
-}
-
-static void float2s16_2 (float * _f, int16_t * s16)
-{
-    int i;
-    int32_t * f = (int32_t *) _f;
-
-    for (i = 0; i < 256; i++) {
-      s16[2*i] = convert (f[i]);
-        s16[2*i+1] = convert (f[i+256]);
-    }
+    a52_free( p_a52->p_a52_state );
+    free( p_a52 );
 }
 
-/*****************************************************************************
- * BitstreamCallback: Import parameters from the new data/PES packet
- *****************************************************************************
- * This function is called by input's NextDataPacket.
- *****************************************************************************/
-static void BitstreamCallback ( bit_stream_t * p_bit_stream,
-                                vlc_bool_t b_new_pes )
-{
-    if( b_new_pes )
-    {
-        /* Drop special A52 header */
-/*        p_bit_stream->p_byte += 3; */
-    }
-}
index 71bfaca7d7263a102aa6eb063d786f06ad69a22d..2c5934b6f4ad4243f2f31baf55c57e2782a3e160 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.h,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: a52.h,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
  *****************************************************************************/
 
 /*****************************************************************************
- * a52_adec_thread_t : a52 decoder thread descriptor
+ * a52_thread_t : a52 decoder thread descriptor
  *****************************************************************************/
-typedef struct a52_adec_thread_s
+typedef struct a52_thread_s
 {
     /*
      * liba52 properties
      */
-    a52_state_t *p_a52_state;
-    int         frame_size;
-    int         flags;
-    int         sample_rate;
-    int         bit_rate;
-    vlc_bool_t  b_dynrng;
+    a52_state_t *       p_a52_state;
+    vlc_bool_t          b_dynrng;
 
     /* The bit stream structure handles the PES stream at the bit level */
     bit_stream_t        bit_stream;
@@ -44,16 +40,14 @@ typedef struct a52_adec_thread_s
     /*
      * Input properties
      */
-    decoder_fifo_t     *p_fifo;                /* stores the PES stream data */
-    data_packet_t      *p_data;
+    decoder_fifo_t *    p_fifo;                /* stores the PES stream data */
+    data_packet_t *     p_data;
 
     /*
      * Output properties
      */
-    aout_fifo_t        *p_aout_fifo; /* stores the decompressed audio frames */
-    int                i_channels;
-
-    /* temporary buffer to store the raw frame to be decoded */
-    u8 p_frame_buffer[3840];
-
-} a52_adec_thread_t;
+    aout_instance_t *   p_aout; /* opaque */
+    aout_input_t *      p_aout_input; /* opaque */
+    audio_sample_format_t output_format;
+    mtime_t             last_date;
+} a52_thread_t;
index 4f192832ac2889bce8eaa7e53c64e7676fa7fc26..4d11cdb329582361c2f3e7f30a3162e036c96abf 100644 (file)
@@ -1,11 +1,12 @@
 /*****************************************************************************
  * aout.m: CoreAudio output plugin
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: aout.m,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * Copyright (C) 2002 VideoLAN
+ * $Id: aout.m,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
+ *          Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Preamble
  *****************************************************************************/
 #include <string.h>
+#include <stdlib.h>
 
 #include <vlc/vlc.h>
 #include <vlc/aout.h>
+#include "aout_internal.h"
 
 #include <Carbon/Carbon.h>
 #include <CoreAudio/AudioHardware.h>
 struct aout_sys_t
 {
     AudioDeviceID       device;         // the audio device
-    AudioConverterRef   s_converter;    // the AudioConverter
-    int                 b_format;       // format begun 
-
-    AudioStreamBasicDescription s_src_stream_format;
-    AudioStreamBasicDescription s_dst_stream_format;
-
-    Ptr                 p_buffer;       // ptr to the 32 bit float data
-    UInt32              ui_buffer_size; // audio device buffer size
-    vlc_bool_t          b_buffer_data;  // available buffer data?
-    vlc_mutex_t         mutex_lock;     // pthread locks for sync of
-    vlc_cond_t          cond_sync;      // Play and callback
-    mtime_t             clock_diff;     // diff between system clock & audio
+
+    AudioStreamBasicDescription stream_format;
+
+    UInt32              i_buffer_size;  // audio device buffer size
+    mtime_t             clock_diff;
 };
 
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int      SetFormat       ( aout_thread_t * );
-static int      GetBufInfo      ( aout_thread_t *, int );
-static void     Play            ( aout_thread_t *, byte_t *, int );
-
-static int      CABeginFormat   ( aout_thread_t * );
-static int      CAEndFormat     ( aout_thread_t * );
+static int      SetFormat       ( aout_instance_t *p_aout );
+static void     Play            ( aout_instance_t *p_aout,
+                                  aout_buffer_t *p_buffer );
 
-static OSStatus CAIOCallback    ( AudioDeviceID inDevice,
+static OSStatus IOCallback      ( AudioDeviceID inDevice,
                                   const AudioTimeStamp *inNow, 
                                   const void *inInputData, 
                                   const AudioTimeStamp *inInputTime,
@@ -77,415 +70,192 @@ static OSStatus CAIOCallback    ( AudioDeviceID inDevice,
                                   void *threadGlobals );
 
 /*****************************************************************************
- * OpenAudio: opens a CoreAudio HAL device
+ * Open: open a CoreAudio HAL device
  *****************************************************************************/
-int E_(OpenAudio) ( vlc_object_t *p_this )
+int E_(OpenAudio)( vlc_object_t * p_this )
 {
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
     OSStatus err;
-    UInt32 ui_param_size;
-
-    /* allocate instance */
-    p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
-    if( p_aout->p_sys == NULL )
+    UInt32 i_param_size;
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+    struct aout_sys_t * p_sys;
+
+    /* Allocate instance */
+    p_sys = p_aout->output.p_sys = malloc( sizeof( struct aout_sys_t ) );
+    memset( p_sys, 0, sizeof( struct aout_sys_t ) );
+    if( p_aout->output.p_sys == NULL )
     {
         msg_Err( p_aout, "out of memory" );
         return( 1 );
     }
 
-    /* initialize members */
-    memset( p_aout->p_sys, 0, sizeof( aout_sys_t ) );
-
-    /* get the default output device */
-    ui_param_size = sizeof( p_aout->p_sys->device );
+    /* Get the default output device */
+    /* FIXME : be more clever in choosing from several devices */
+    i_param_size = sizeof( p_sys->device );
     err = AudioHardwareGetProperty( kAudioHardwarePropertyDefaultOutputDevice,
-                                    &ui_param_size, 
-                                    (void *)&p_aout->p_sys->device );
-
+                                    &i_param_size, 
+                                    (void *)&p_sys->device );
     if( err != noErr ) 
     {
         msg_Err( p_aout, "failed to get the device: %d", err );
         return( -1 );
     }
 
-    /* get the buffer size that the device uses for IO */
-    ui_param_size = sizeof( p_aout->p_sys->ui_buffer_size );
-    err = AudioDeviceGetProperty( p_aout->p_sys->device, 0, false, 
-                                  kAudioDevicePropertyBufferSize, 
-                                  &ui_param_size,
-                                  &p_aout->p_sys->ui_buffer_size );
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "failed to get device buffer size: %d", err );
-        return( -1 );
-    }
-
-    /* get a description of the data format used by the device */
-    ui_param_size = sizeof( p_aout->p_sys->s_dst_stream_format ); 
-    err = AudioDeviceGetProperty( p_aout->p_sys->device, 0, false, 
-                                  kAudioDevicePropertyStreamFormat, 
-                                  &ui_param_size,
-                                  &p_aout->p_sys->s_dst_stream_format );
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "failed to get dst stream format: %d", err );
-        return( -1 );
-    }
+    p_aout->output.pf_setformat = SetFormat;
+    p_aout->output.pf_play = Play;
 
-    if( p_aout->p_sys->s_dst_stream_format.mFormatID != kAudioFormatLinearPCM )
-    {
-        msg_Err( p_aout, "kAudioFormatLinearPCM required" );
-        return( -1 );
-    }
-
-    /* initialize mutex and cond */
-    vlc_mutex_init( p_aout, &p_aout->p_sys->mutex_lock );
-    vlc_cond_init( p_aout, &p_aout->p_sys->cond_sync );
-
-    /* initialize source stream format */
-    memcpy( &p_aout->p_sys->s_src_stream_format,
-            &p_aout->p_sys->s_dst_stream_format,
-            sizeof( p_aout->p_sys->s_src_stream_format ) );
-
-    if( CABeginFormat( p_aout ) )
-    {
-        msg_Err( p_aout, "CABeginFormat failed" );
-        return( -1 );
-    }
-
-    p_aout->pf_setformat = SetFormat;
-    p_aout->pf_getbufinfo = GetBufInfo;
-    p_aout->pf_play = Play;
-
-    return( 0 );
+    return 0;
 }
 
 /*****************************************************************************
- * SetFormat: pretends to set the dsp output format
+ * SetFormat: find the closest available format from p_format
  *****************************************************************************/
-static int SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_instance_t * p_aout )
 {
-    if( CAEndFormat( p_aout ) )
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
+    OSErr err;
+
+    /* Get a description of the data format used by the device */
+    UInt32 i_param_size = sizeof( p_sys->stream_format ); 
+    err = AudioDeviceGetProperty( p_sys->device, 0, false, 
+                                  kAudioDevicePropertyStreamFormat, 
+                                  &i_param_size,
+                                  &p_sys->stream_format );
+    if( err != noErr )
     {
-        msg_Err( p_aout, "CAEndFormat failed" );
-        return( -1 );
+        msg_Err( p_aout, "failed to get stream format: %d", err );
+        return -1 ;
     }
 
-    switch( p_aout->i_format )
+    if( p_sys->stream_format.mFormatID != kAudioFormatLinearPCM )
     {
-        case AOUT_FMT_S8:
-            msg_Err( p_aout,
-                     "Signed 8 not supported yet, please report stream" );
-            return( -1 );
-                    
-        case AOUT_FMT_U8:
-            msg_Err( p_aout,
-                     "Unsigned 8 not supported yet, please report stream" );
-            return( -1 );
-
-        case AOUT_FMT_S16_LE:
-            p_aout->p_sys->s_src_stream_format.mFormatFlags &=
-                ~kLinearPCMFormatFlagIsBigEndian;
-            p_aout->p_sys->s_src_stream_format.mFormatFlags |=
-                kLinearPCMFormatFlagIsSignedInteger;
-            break;
-
-        case AOUT_FMT_S16_BE:
-            p_aout->p_sys->s_src_stream_format.mFormatFlags |=
-                kLinearPCMFormatFlagIsBigEndian;
-            p_aout->p_sys->s_src_stream_format.mFormatFlags |=
-                kLinearPCMFormatFlagIsSignedInteger;
-            break;
-
-        case AOUT_FMT_U16_LE:
-            p_aout->p_sys->s_src_stream_format.mFormatFlags &=
-                ~kLinearPCMFormatFlagIsBigEndian;
-            p_aout->p_sys->s_src_stream_format.mFormatFlags &=
-                ~kLinearPCMFormatFlagIsSignedInteger;
-            break;
-                    
-        case AOUT_FMT_U16_BE:
-            p_aout->p_sys->s_src_stream_format.mFormatFlags |=
-                kLinearPCMFormatFlagIsBigEndian;
-            p_aout->p_sys->s_src_stream_format.mFormatFlags &=
-                ~kLinearPCMFormatFlagIsSignedInteger;
-            break;
-                    
-        default:
-            msg_Err( p_aout, "audio format (0x%08x) not supported now,"
-                             "please report stream", p_aout->i_format );
-            return( -1 );
+        msg_Err( p_aout, "kAudioFormatLinearPCM required" );
+        return -1 ;
     }
 
-    /* source format is not float */
-    p_aout->p_sys->s_src_stream_format.mFormatFlags &=
-        ~kLinearPCMFormatFlagIsFloat;
-
-    /* if destination format is float, take size diff into account */
-    if( p_aout->p_sys->s_dst_stream_format.mFormatFlags & 
-        kLinearPCMFormatFlagIsFloat )
+    /* We only deal with floats */
+    if ( p_aout->output.output.i_format != AOUT_FMT_FLOAT32 )
     {
-        p_aout->p_sys->s_src_stream_format.mBytesPerPacket =
-            p_aout->p_sys->s_dst_stream_format.mBytesPerPacket / 2;
-        p_aout->p_sys->s_src_stream_format.mBytesPerFrame =
-            p_aout->p_sys->s_src_stream_format.mBytesPerFrame / 2;
-        p_aout->p_sys->s_src_stream_format.mBitsPerChannel =
-            p_aout->p_sys->s_src_stream_format.mBitsPerChannel / 2;
+        msg_Err( p_aout, "cannot set format 0x%x",
+                 p_aout->output.output.i_format );
+        return -1;
     }
-
-    /* set sample rate and channels per frame */
-    p_aout->p_sys->s_src_stream_format.mSampleRate = p_aout->i_rate; 
-    p_aout->p_sys->s_src_stream_format.mChannelsPerFrame = p_aout->i_channels;
-
-    if( CABeginFormat( p_aout ) )
+    p_sys->stream_format.mFormatFlags |=
+        kLinearPCMFormatFlagIsFloat;
+
+    /* Set sample rate and channels per frame */
+    p_sys->stream_format.mSampleRate
+                 = p_aout->output.output.i_rate; 
+    p_sys->stream_format.mChannelsPerFrame
+                 = p_aout->output.output.i_channels;
+
+    /* Get the buffer size that the device uses for IO */
+    i_param_size = sizeof( p_sys->i_buffer_size );
+#if 0
+    err = AudioDeviceGetProperty( p_sys->device, 0, false, 
+                                  kAudioDevicePropertyBufferSize, 
+                                  &i_param_size, &p_sys->i_buffer_size );
+msg_Dbg( p_aout, "toto : %d", p_sys->i_buffer_size );
+#else
+    p_sys->i_buffer_size = sizeof(float) * p_aout->output.output.i_channels
+                            * 1536;
+    err = AudioDeviceSetProperty( p_sys->device, 0, 0, false,
+                                  kAudioDevicePropertyBufferSize,
+                                  i_param_size, &p_sys->i_buffer_size );
+#endif
+    if( err != noErr )
     {
-        msg_Err( p_aout, "CABeginFormat failed" );
+        msg_Err( p_aout, "failed to set device buffer size: %d", err );
         return( -1 );
     }
 
-    return( 0 );
-}
-
-/*****************************************************************************
- * GetBufInfo: returns available bytes in buffer
- *****************************************************************************/
-static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
-{
-    return( 0 ); /* send data as soon as possible */
-}
+    p_aout->output.i_nb_samples = p_sys->i_buffer_size / sizeof(float)
+                                   / p_aout->output.output.i_channels;
 
-/*****************************************************************************
- * CAIOCallback : callback for audio output
- *****************************************************************************/
-static OSStatus CAIOCallback( AudioDeviceID inDevice,
-                              const AudioTimeStamp *inNow, 
-                              const void *inInputData,
-                              const AudioTimeStamp *inInputTime, 
-                              AudioBufferList *outOutputData,
-                              const AudioTimeStamp *inOutputTime, 
-                              void *threadGlobals )
-{
-    aout_thread_t *p_aout = (aout_thread_t *)threadGlobals;
-    aout_sys_t *p_sys = p_aout->p_sys;
-
-    AudioTimeStamp host_time;
-
-    host_time.mFlags = kAudioTimeStampHostTimeValid;
-    AudioDeviceTranslateTime( inDevice, inOutputTime, &host_time );
-    //intf_Msg( "%lld", AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000 + p_aout->p_sys->clock_diff - p_aout->date );
-    p_aout->date = p_aout->p_sys->clock_diff + AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000;
+    /* Add callback */
+    err = AudioDeviceAddIOProc( p_sys->device,
+                                (AudioDeviceIOProc)IOCallback,
+                                (void *)p_aout );
 
-    /* move data into output data buffer */
-    if( p_sys->b_buffer_data )
-    {
-        BlockMoveData( p_sys->p_buffer,
-                       outOutputData->mBuffers[ 0 ].mData, 
-                       p_sys->ui_buffer_size );
-    }
-    else
+    /* Open the output with callback IOCallback */
+    err = AudioDeviceStart( p_sys->device,
+                            (AudioDeviceIOProc)IOCallback );
+    if( err != noErr )
     {
-        memset(outOutputData->mBuffers[ 0 ].mData, 0, p_sys->ui_buffer_size);
-//X        msg_Warn( p_aout, "audio output is starving, expect glitches" );
+        msg_Err( p_aout, "AudioDeviceStart failed: %d", err );
+        return -1;
     }
 
-    /* see Play below */
-    vlc_mutex_lock( &p_sys->mutex_lock );
-    p_sys->b_buffer_data = 0;
-    vlc_cond_signal( &p_sys->cond_sync );
-    vlc_mutex_unlock( &p_sys->mutex_lock );
+    /* Let's pray for the following operation to be atomic... */
+    p_sys->clock_diff = mdate()
+         - AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()) / 1000;
 
-    return( noErr );     
+    return 0;
 }
 
 /*****************************************************************************
- * Play: play a sound
+ * Close: close the CoreAudio HAL device
  *****************************************************************************/
-static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+void E_(CloseAudio)( aout_instance_t * p_aout )
 {
-    OSStatus err;
-    UInt32 ui_buffer_size = p_aout->p_sys->ui_buffer_size;
-
-    /* 
-     * wait for a callback to occur (to flush the buffer), so Play
-     * can't be called twice, losing the data we just wrote. 
-     */
-    vlc_mutex_lock( &p_aout->p_sys->mutex_lock );
-    if ( p_aout->p_sys->b_buffer_data )
-    {
-        vlc_cond_wait( &p_aout->p_sys->cond_sync, &p_aout->p_sys->mutex_lock );
-    }
-    vlc_mutex_unlock( &p_aout->p_sys->mutex_lock );
-
-    err = AudioConverterConvertBuffer( p_aout->p_sys->s_converter,
-                                       i_size, buffer,
-                                       &ui_buffer_size,
-                                       p_aout->p_sys->p_buffer );
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
+    OSStatus err; 
 
+    /* Stop playing sound through the device */
+    err = AudioDeviceStop( p_sys->device,
+                           (AudioDeviceIOProc)IOCallback ); 
     if( err != noErr )
     {
-        msg_Err( p_aout, "ConvertBuffer failed: %d", err );
-    }
-    else
-    {
-        p_aout->p_sys->b_buffer_data = 1;
-    }
-}
-
-/*****************************************************************************
- * CloseAudio: closes the CoreAudio HAL device
- *****************************************************************************/
-void E_(CloseAudio) ( vlc_object_t *p_this )
-{
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
-
-    if( CAEndFormat( p_aout ) )
-    {
-        msg_Err( p_aout, "CAEndFormat failed" );
+        msg_Err( p_aout, "AudioDeviceStop failed: %d", err );
     }
 
-    /* destroy lock and cond */
-    vlc_mutex_destroy( &p_aout->p_sys->mutex_lock );
-    vlc_cond_destroy( &p_aout->p_sys->cond_sync );
-
-    free( p_aout->p_sys );
+    free( p_sys );
 }
 
 /*****************************************************************************
- * CABeginFormat: creates an AudioConverter 
+ * Play: queue a buffer for playing by IOCallback
  *****************************************************************************/
-static int CABeginFormat( aout_thread_t *p_aout )
+static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 {
-    OSStatus err;
-    UInt32 ui_param_size;
-
-    if( p_aout->p_sys->b_format )
-    {
-        msg_Err( p_aout, "CABeginFormat (b_format)" );
-        return( 1 );
-    }
-
-    p_aout->p_sys->ui_buffer_size = 2 * 2 * sizeof(s16) * 
-        ((s64)p_aout->i_rate * AOUT_BUFFER_DURATION) / 1000000; 
-
-    /* set the buffer size that the device uses for IO */
-    ui_param_size = sizeof( p_aout->p_sys->ui_buffer_size );
-    err = AudioDeviceSetProperty( p_aout->p_sys->device, 0, 0, false, 
-                                  kAudioDevicePropertyBufferSize, 
-                                  ui_param_size,
-                                  &p_aout->p_sys->ui_buffer_size );
-    //p_aout->i_latency = p_aout->p_sys->ui_buffer_size / 2;
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "AudioDeviceSetProperty failed: %d", err );
-        return( 1 );
-    }
-
-    /* allocate audio buffer */ 
-    p_aout->p_sys->p_buffer = NewPtrClear( p_aout->p_sys->ui_buffer_size );
-
-    if( p_aout->p_sys->p_buffer == nil )
-    {
-        msg_Err( p_aout, "failed to allocate audio buffer" );
-        return( 1 );
-    }
-
-    /* create a new AudioConverter */
-    err = AudioConverterNew( &p_aout->p_sys->s_src_stream_format,
-                             &p_aout->p_sys->s_dst_stream_format,
-                             &p_aout->p_sys->s_converter );
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "AudioConverterNew failed: %d", err );
-        DisposePtr( p_aout->p_sys->p_buffer );
-        return( 1 );
-    }
-
-    /* add callback */
-    err = AudioDeviceAddIOProc( p_aout->p_sys->device, 
-                                (AudioDeviceIOProc)CAIOCallback, 
-                                (void *)p_aout );
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "AudioDeviceAddIOProc failed: %d", err );
-        AudioConverterDispose( p_aout->p_sys->s_converter );
-        DisposePtr( p_aout->p_sys->p_buffer );
-        return( 1 );
-    } 
-
-    /* open the output */
-    err = AudioDeviceStart( p_aout->p_sys->device,
-                            (AudioDeviceIOProc)CAIOCallback );
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "AudioDeviceStart failed: %d", err );
-        AudioConverterDispose( p_aout->p_sys->s_converter );
-        DisposePtr( p_aout->p_sys->p_buffer );
-        return( 1 );
-    }
-
-    /* Let's pray for the following operation to be atomic... */
-    p_aout->p_sys->clock_diff = mdate()
-         - AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()) / 1000
-         + (mtime_t)p_aout->p_sys->ui_buffer_size / 4 * 1000000 / (mtime_t)p_aout->i_rate
-         + p_aout->p_vlc->i_desync;
-
-    p_aout->p_sys->b_format = 1;
-
-    return( 0 );
+    aout_FifoPush( p_aout, &p_aout->output.fifo, p_buffer );
 }
 
 /*****************************************************************************
- * CAEndFormat: destroys the AudioConverter 
+ * IOCallback : callback for audio output
  *****************************************************************************/
-static int CAEndFormat( aout_thread_t *p_aout )
+static OSStatus IOCallback( AudioDeviceID inDevice,
+                            const AudioTimeStamp *inNow, 
+                            const void *inInputData,
+                            const AudioTimeStamp *inInputTime, 
+                            AudioBufferList *outOutputData,
+                            const AudioTimeStamp *inOutputTime, 
+                            void *threadGlobals )
 {
-    OSStatus err; 
+    aout_instance_t * p_aout = (aout_instance_t *)threadGlobals;
+    struct aout_sys_t * p_sys = p_aout->output.p_sys;
+    mtime_t         current_date;
+    AudioTimeStamp  host_time;
+    aout_buffer_t * p_buffer;
 
-    if( !p_aout->p_sys->b_format )
-    {
-        msg_Err( p_aout, "CAEndFormat (!b_format)" );
-        return( 1 );
-    }
-
-    /* stop playing sound through the device */
-    err = AudioDeviceStop( p_aout->p_sys->device,
-                           (AudioDeviceIOProc)CAIOCallback ); 
-
-    if( err != noErr )
-    {
-        msg_Err( p_aout, "AudioDeviceStop failed: %d", err );
-        return( 1 );
-    }
+    host_time.mFlags = kAudioTimeStampHostTimeValid;
+    AudioDeviceTranslateTime( inDevice, inOutputTime, &host_time );
+    current_date = p_sys->clock_diff
+                 + AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000;
 
-    /* remove the callback */
-    err = AudioDeviceRemoveIOProc( p_aout->p_sys->device,
-                                   (AudioDeviceIOProc)CAIOCallback ); 
+    p_buffer = aout_OutputNextBuffer( p_aout, current_date );
 
-    if( err != noErr )
+    /* move data into output data buffer */
+    if ( p_buffer != NULL )
     {
-        msg_Err( p_aout, "AudioDeviceRemoveIOProc failed: %d", err );
-        return( 1 );
+        BlockMoveData( p_buffer->p_buffer,
+                       outOutputData->mBuffers[ 0 ].mData, 
+                       p_sys->i_buffer_size );
+        aout_BufferFree( p_buffer );
     }
-
-    /* destroy the AudioConverter */
-    err = AudioConverterDispose( p_aout->p_sys->s_converter );
-
-    if( err != noErr )
+    else
     {
-        msg_Err( p_aout, "AudioConverterDispose failed: %d", err );
-        return( 1 );
+        memset(outOutputData->mBuffers[ 0 ].mData, 0, p_sys->i_buffer_size);
     }
 
-    /* release audio buffer */
-    DisposePtr( p_aout->p_sys->p_buffer );
-
-    p_aout->p_sys->b_format = 0;
-
-    return( 0 );
+    return noErr;     
 }
+
index e39ea9c96568459055e1555c8914e9c39dd1ac8e..82b994890a437249319bbc539e15f512a82abd1c 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.m,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: vout.m,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -58,7 +58,6 @@ struct picture_sys_t
 static int  vout_Init      ( vout_thread_t * );
 static void vout_End       ( vout_thread_t * );
 static int  vout_Manage    ( vout_thread_t * );
-static void vout_Render    ( vout_thread_t *, picture_t * );
 static void vout_Display   ( vout_thread_t *, picture_t * );
 
 static int  CoSendRequest      ( vout_thread_t *, long );
@@ -719,6 +718,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
 
     switch( key )
     {
+#if 0
         case (unichar)0xf700: /* up-arrow */
         { 
             aout_thread_t * p_aout = vlc_object_find( p_vout, VLC_OBJECT_AOUT,
@@ -750,6 +750,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
             }
         }
         break;
+#endif
 
         case 'f': case 'F':
             [self toggleFullscreen];
index 20c45aa9d4845bdf96f47b784a7fbdbaf920b12b..abbfa7c26247378d8dd019f4d7ee0856ad73a8e6 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * Copyright (C) 2002 VideoLAN
+ * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Preamble
  *****************************************************************************/
 #include <string.h>
+#include <stdlib.h>
 
 #include <vlc/vlc.h>
 #include <vlc/aout.h>
 
+#include "aout_internal.h"
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int     SetFormat   ( aout_thread_t * );
-static int     GetBufInfo  ( aout_thread_t *, int );
-static void    Play        ( aout_thread_t *, byte_t *, int );
+static int     SetFormat   ( aout_instance_t * );
+static void    Play        ( aout_instance_t *, aout_buffer_t * );
 
 /*****************************************************************************
- * OpenAudio: opens a dummy audio device
+ * OpenAudio: open a dummy audio device
  *****************************************************************************/
-int E_(OpenAudio) ( vlc_object_t *p_this )
+int E_(OpenAudio) ( vlc_object_t * p_this )
 {
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    p_aout->pf_setformat = SetFormat;
-    p_aout->pf_getbufinfo = GetBufInfo;
-    p_aout->pf_play = Play;
+    p_aout->output.pf_setformat = SetFormat;
+    p_aout->output.pf_play = Play;
 
     return VLC_SUCCESS;
 }
 
 /*****************************************************************************
- * SetFormat: pretends to set the dsp output format
- *****************************************************************************/
-static int SetFormat( aout_thread_t *p_aout )
-{
-    return( 0 );
-}
-
-/*****************************************************************************
- * GetBufInfo: returns available bytes in buffer
+ * SetFormat: pretend to set the dsp output format
  *****************************************************************************/
-static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int SetFormat( aout_instance_t * p_aout )
 {
-    return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
+    p_aout->output.i_nb_samples = 2048;
+    return 0;
 }
 
 /*****************************************************************************
- * Play: pretends to play a sound
+ * Play: pretend to play a sound
  *****************************************************************************/
-static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 {
-    ;
+    aout_BufferFree( p_buffer );
 }
 
index 8ccd5d470ff9b854cb5f86f520293f1c26e32332..e3e72d042e01557d26d8dc581aa2db307ead5b1f 100644 (file)
@@ -2,7 +2,7 @@
  * dummy.c : dummy plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: dummy.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: dummy.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -56,10 +56,10 @@ vlc_module_begin();
         set_capability( "decoder", 0 );
         set_callbacks( E_(OpenDecoder), NULL );
     add_submodule();
-        set_capability( "audio output", 0 );
+        set_capability( "audio output", 1 );
         set_callbacks( E_(OpenAudio), NULL );
     add_submodule();
-        set_capability( "video output", 0 );
+        set_capability( "video output", 1 );
         set_callbacks( E_(OpenVideo), NULL );
         add_category_hint( N_("Video"), NULL );
         add_string( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT );
index 0c6f15286f0e60a8ae1c88356d21484d2c6edecd..6b511a4f18eb0b73066f534456613b3489a2f030 100644 (file)
@@ -2,7 +2,7 @@
  * aout_sdl.c : audio sdl functions library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout.c,v 1.1 2002/08/04 17:23:44 sam Exp $
+ * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 
 #include <vlc/vlc.h>
 #include <vlc/aout.h>
+#include "aout_internal.h"
 
 #include SDL_INCLUDE_FILE
 
-/*****************************************************************************
- * aout_sys_t: dsp audio output method descriptor
- *****************************************************************************
- * This structure is part of the audio output thread descriptor.
- * It describes the dsp specific properties of an audio device.
- *****************************************************************************/
-
-/* the overflow limit is used to prevent the fifo from growing too big */
-#define OVERFLOWLIMIT 100000
-
-struct aout_sys_t
-{
-    byte_t  * audio_buf;
-    int i_audio_end;
-
-    vlc_bool_t b_active;
-};
+#define DEFAULT_FRAME_SIZE 2048
 
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int     SetFormat   ( aout_thread_t * );
-static int     GetBufInfo  ( aout_thread_t *, int );
-static void    Play        ( aout_thread_t *, byte_t *, int );
+static int     SetFormat   ( aout_instance_t * );
+static void    Play        ( aout_instance_t *, aout_buffer_t * );
 
 static void    SDLCallback ( void *, Uint8 *, int );
 
 /*****************************************************************************
  * OpenAudio: open the audio device
- *****************************************************************************
- * This function opens the dsp as a usual non-blocking write-only file, and
- * modifies the p_aout->i_fd with the file's descriptor.
  *****************************************************************************/
-int E_(OpenAudio) ( vlc_object_t *p_this )
+int E_(OpenAudio) ( aout_instance_t *p_aout )
 {
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
-
-    SDL_AudioSpec desired;
-
     if( SDL_WasInit( SDL_INIT_AUDIO ) != 0 )
     {
         return( 1 );
     }
 
-    p_aout->pf_setformat = SetFormat;
-    p_aout->pf_getbufinfo = GetBufInfo;
-    p_aout->pf_play = Play;
-
-    /* Allocate structure */
-    p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
-
-    if( p_aout->p_sys == NULL )
-    {
-        msg_Err( p_aout, "out of memory" );
-        return( 1 );
-    }
+    p_aout->output.pf_setformat = SetFormat;
+    p_aout->output.pf_play = Play;
 
     /* Initialize library */
     if( SDL_Init( SDL_INIT_AUDIO
@@ -108,121 +75,49 @@ int E_(OpenAudio) ( vlc_object_t *p_this )
                 ) < 0 )
     {
         msg_Err( p_aout, "cannot initialize SDL (%s)", SDL_GetError() );
-        free( p_aout->p_sys );
         return( 1 );
     }
 
-    p_aout->p_sys->i_audio_end = 0;
-    p_aout->p_sys->audio_buf = malloc( OVERFLOWLIMIT );
-
-    /* Initialize some variables */
-
-    /* TODO: write conversion beetween AOUT_FORMAT_DEFAULT
-     * AND AUDIO* from SDL. */
-    desired.freq       = p_aout->i_rate;
-#ifdef WORDS_BIGENDIAN
-    desired.format     = AUDIO_S16MSB;                     /* stereo 16 bits */
-#else
-    desired.format     = AUDIO_S16LSB;                     /* stereo 16 bits */
-#endif
-    desired.channels   = p_aout->i_channels;
-    desired.callback   = SDLCallback;
-    desired.userdata   = p_aout->p_sys;
-    desired.samples    = 1024;
-
-    /* Open the sound device
-     * we just ask the SDL to wrap at the good frequency if the one we
-     * ask for is unavailable. This is done by setting the second parar
-     * to NULL
-     */
-    if( SDL_OpenAudio( &desired, NULL ) < 0 )
-    {
-        msg_Err( p_aout, "SDL_OpenAudio failed (%s)", SDL_GetError() );
-        SDL_QuitSubSystem( SDL_INIT_AUDIO );
-        free( p_aout->p_sys );
-        return( -1 );
-    }
-
-    p_aout->p_sys->b_active = 1;
-    SDL_PauseAudio( 0 );
-
     return( 0 );
 }
 
 /*****************************************************************************
  * SetFormat: reset the audio device and sets its format
- *****************************************************************************
- * This functions resets the audio device, tries to initialize the output
- * format with the value contained in the dsp structure, and if this value
- * could not be set, the default value returned by ioctl is set. It then
- * does the same for the stereo mode, and for the output rate.
  *****************************************************************************/
-static int SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_instance_t *p_aout )
 {
     /* TODO: finish and clean this */
     SDL_AudioSpec desired;
 
-    /*i_format = p_aout->i_format;*/
-    desired.freq       = p_aout->i_rate;             /* Set the output rate */
-#ifdef WORDS_BIGENDIAN
-    desired.format     = AUDIO_S16MSB;                    /* stereo 16 bits */
-#else
-    desired.format     = AUDIO_S16LSB;                    /* stereo 16 bits */
-#endif
-    desired.channels   = p_aout->i_channels;
+    desired.freq       = p_aout->output.output.i_rate;
+    desired.format     = AUDIO_S16SYS;
+    desired.channels   = p_aout->output.output.i_channels;
     desired.callback   = SDLCallback;
-    desired.userdata   = p_aout->p_sys;
-    desired.samples    = 2048;
-
-    /* Open the sound device */
-    SDL_PauseAudio( 1 );
-    SDL_CloseAudio();
+    desired.userdata   = p_aout;
+    desired.samples    = DEFAULT_FRAME_SIZE;
 
+    /* Open the sound device - FIXME : get the "natural" paramaters */
     if( SDL_OpenAudio( &desired, NULL ) < 0 )
     {
-        p_aout->p_sys->b_active = 0;
-        return( -1 );
+        return -1;
     }
 
-    p_aout->p_sys->b_active = 1;
-    SDL_PauseAudio( 0 );
+    p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+    p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
 
-    return( 0 );
-}
+    SDL_PauseAudio( 0 );
 
-/*****************************************************************************
- * GetBufInfo: buffer status query
- *****************************************************************************
- * returns the number of bytes in the audio buffer compared to the size of
- * i_buffer_limit...
- *****************************************************************************/
-static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
-{
-    if(i_buffer_limit > p_aout->p_sys->i_audio_end)
-    {
-        /* returning 0 here juste gives awful sound in the speakers :/ */
-        return( i_buffer_limit );
-    }
-    return( p_aout->p_sys->i_audio_end - i_buffer_limit);
+    return 0;
 }
 
 /*****************************************************************************
  * Play: play a sound samples buffer
- *****************************************************************************
- * This function writes a buffer of i_length bytes in the dsp
  *****************************************************************************/
-static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 {
-    byte_t * audio_buf = p_aout->p_sys->audio_buf;
-
     SDL_LockAudio();                                     /* Stop callbacking */
 
-    p_aout->p_sys->audio_buf = realloc( audio_buf,
-                                        p_aout->p_sys->i_audio_end + i_size);
-    memcpy( p_aout->p_sys->audio_buf + p_aout->p_sys->i_audio_end,
-            buffer, i_size);
-
-    p_aout->p_sys->i_audio_end += i_size;
+    aout_FifoPush( p_aout, &p_aout->output.fifo, p_buffer );
 
     SDL_UnlockAudio();                                  /* go on callbacking */
 }
@@ -230,51 +125,38 @@ static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 /*****************************************************************************
  * CloseAudio: close the audio device
  *****************************************************************************/
-void E_(CloseAudio) ( vlc_object_t *p_this )
+void E_(CloseAudio) ( aout_instance_t *p_aout )
 {
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
-
-    if( p_aout->p_sys->b_active )
-    {
-        SDL_PauseAudio( 1 );                                  /* pause audio */
-
-        if( p_aout->p_sys->audio_buf != NULL )  /* do we have a buffer now ? */
-        {
-            free( p_aout->p_sys->audio_buf );
-        }
-    }
+    SDL_PauseAudio( 1 );
 
     SDL_CloseAudio();
 
     SDL_QuitSubSystem( SDL_INIT_AUDIO );
-
-    free( p_aout->p_sys );                              /* Close the Output. */
 }
 
 /*****************************************************************************
  * SDLCallback: what to do once SDL has played sound samples
  *****************************************************************************/
-static void SDLCallback( void *userdata, byte_t *stream, int len )
+static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
 {
-    aout_sys_t * p_sys = userdata;
+    aout_instance_t * p_aout = (aout_instance_t *)_p_aout;
+    /* FIXME : take into account SDL latency instead of mdate() */
+    aout_buffer_t * p_buffer = aout_OutputNextBuffer( p_aout, mdate() );
 
-    if( p_sys->i_audio_end > OVERFLOWLIMIT )
+    if ( i_len != DEFAULT_FRAME_SIZE * sizeof(s16)
+                    * p_aout->output.output.i_channels )
     {
-//X        msg_Err( p_aout, "aout_SDLCallback overflowed" );
-
-        free( p_sys->audio_buf );
-        p_sys->audio_buf = NULL;
-
-        p_sys->i_audio_end = 0;
-        /* we've gone to slow, increase output freq */
+        msg_Err( p_aout, "SDL doesn't know its buffer size (%d)", i_len );
     }
 
-    /* if we are not in underrun */
-    if( p_sys->i_audio_end > len )
+    if ( p_buffer != NULL )
+    {
+        p_aout->p_vlc->pf_memcpy( p_stream, p_buffer->p_buffer, i_len );
+        aout_BufferFree( p_buffer );
+    }
+    else
     {
-        p_sys->i_audio_end -= len;
-        memcpy( stream, p_sys->audio_buf, len );
-        memmove( p_sys->audio_buf, p_sys->audio_buf + len, p_sys->i_audio_end );
+        memset( p_stream, 0, i_len );
     }
 }
 
diff --git a/src/audio_output/aout_ext-dec.c b/src/audio_output/aout_ext-dec.c
deleted file mode 100644 (file)
index 14fba9d..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*****************************************************************************
- * aout_ext-dec.c : exported fifo management functions
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.18 2002/06/02 09:03:54 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Cyril Deguet <asmax@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "audio_output.h"
-
-/*****************************************************************************
- * aout_CreateFifo
- *****************************************************************************/
-aout_fifo_t * __aout_CreateFifo( vlc_object_t *p_this, int i_format,
-                                 int i_channels, int i_rate, int i_frame_size,
-                                 void *p_buffer )
-{
-    aout_thread_t *p_aout;
-    aout_fifo_t   *p_fifo = NULL;
-    int i_index;
-
-    /* Spawn an audio output if there is none */
-    p_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE );
-
-    if( p_aout )
-    {
-        if( p_aout->fifo[0].i_format != i_format )
-        {
-            msg_Dbg( p_this, "changing aout type" );
-            vlc_object_detach_all( p_aout );
-            vlc_object_release( p_aout );
-            aout_DestroyThread( p_aout );
-            p_aout = NULL;
-        }
-    }
-
-    if( p_aout == NULL )
-    {
-        msg_Dbg( p_this, "no aout present, spawning one" );
-
-        p_aout = aout_CreateThread( p_this, i_channels, i_rate );
-        /* Everything failed */
-        if( p_aout == NULL )
-        {
-            return NULL;
-        }
-    }
-
-    /* temporary hack to switch output type (mainly for spdif)
-     * FIXME: to be adapted when several output are available */
-    /* Take the fifos lock */
-    vlc_mutex_lock( &p_aout->fifos_lock );
-
-    /* Look for a free fifo structure */
-    for( i_index = 0; i_index < AOUT_MAX_FIFOS; i_index++ )
-    {
-        if( p_aout->fifo[i_index].i_format == AOUT_FIFO_NONE )
-        {
-            p_fifo = &p_aout->fifo[i_index];
-            p_fifo->i_fifo = i_index;
-            break;
-        }
-    }
-
-    if( p_fifo == NULL )
-    {
-        msg_Err( p_aout, "no fifo available" );
-        vlc_mutex_unlock( &p_aout->fifos_lock );
-        return NULL;
-    }
-
-    /* Initialize the new fifo structure */
-    switch ( p_fifo->i_format = i_format )
-    {
-        case AOUT_FIFO_PCM:
-        case AOUT_FIFO_SPDIF:
-            p_fifo->b_die = 0;
-
-            p_fifo->i_channels = i_channels;
-            p_fifo->i_rate = i_rate;
-            p_fifo->i_frame_size = i_frame_size;
-
-            p_fifo->i_unit_limit = (AOUT_FIFO_SIZE + 1)
-                                     * (i_frame_size / i_channels);
-
-            /* Allocate the memory needed to store the audio frames and their
-             * dates. As the fifo is a rotative fifo, we must be able to find
-             * out whether the fifo is full or empty, that's why we must in
-             * fact allocate memory for (AOUT_FIFO_SIZE+1) audio frames. */
-            p_fifo->date = malloc( ( sizeof(s16) * i_frame_size 
-                                      + sizeof(mtime_t) )
-                                   * ( AOUT_FIFO_SIZE + 1 ) );
-            if ( p_fifo->date == NULL )
-            {
-                msg_Err( p_aout, "out of memory" );
-                p_fifo->i_format = AOUT_FIFO_NONE;
-                vlc_mutex_unlock( &p_aout->fifos_lock );
-                return NULL;
-            }
-
-            p_fifo->buffer = (u8 *)p_fifo->date + sizeof(mtime_t)
-                                                     * ( AOUT_FIFO_SIZE + 1 );
-
-            /* Set the fifo's buffer as empty (the first frame that is to be
-             * played is also the first frame that is not to be played) */
-            p_fifo->i_start_frame = 0;
-            /* p_fifo->i_next_frame = 0; */
-            p_fifo->i_end_frame = 0;
-
-            /* Waiting for the audio decoder to compute enough frames to work
-             * out the fifo's current rate (as soon as the decoder has decoded
-             * enough frames, the members of the fifo structure that are not
-             * initialized now will be calculated) */
-            p_fifo->b_start_frame = 0;
-            p_fifo->b_next_frame = 0;
-            break;
-
-        default:
-            msg_Err( p_aout, "unknown fifo type 0x%x", p_fifo->i_format );
-            p_fifo->i_format = AOUT_FIFO_NONE;
-            vlc_mutex_unlock( &p_aout->fifos_lock );
-            return NULL;
-    }
-
-    /* Release the fifos lock */
-    vlc_mutex_unlock( &p_aout->fifos_lock );
-
-    msg_Dbg( p_aout, "fifo #%i allocated, %i channels, rate %li, "
-                     "frame size %i", p_fifo->i_fifo, p_fifo->i_channels,
-                     p_fifo->i_rate, p_fifo->i_frame_size );
-
-    /* Return the pointer to the fifo structure */
-    return p_fifo;
-}
-
-/*****************************************************************************
- * aout_DestroyFifo
- *****************************************************************************/
-void aout_DestroyFifo( aout_fifo_t * p_fifo )
-{
-//X    intf_Warn( p_fifo, 2, "fifo #%i destroyed", p_fifo->i_fifo );
-
-    vlc_mutex_lock( &p_fifo->data_lock );
-    p_fifo->b_die = 1;
-    vlc_mutex_unlock( &p_fifo->data_lock );
-}
-
-/*****************************************************************************
- * aout_FreeFifo
- *****************************************************************************/
-void aout_FreeFifo( aout_fifo_t * p_fifo )
-{
-    switch ( p_fifo->i_format )
-    {
-        case AOUT_FIFO_NONE:
-
-            break;
-
-        case AOUT_FIFO_PCM:
-        case AOUT_FIFO_SPDIF:
-
-            free( p_fifo->date );
-            p_fifo->i_format = AOUT_FIFO_NONE;
-
-            break;
-
-        default:
-
-            break;
-    }
-}
-
diff --git a/src/audio_output/aout_pcm.c b/src/audio_output/aout_pcm.c
deleted file mode 100644 (file)
index 1404de2..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*****************************************************************************
- * aout_pcm.c: PCM audio output functions
- *****************************************************************************
- * Copyright (C) 1999-2002 VideoLAN
- * $Id: aout_pcm.c,v 1.8 2002/06/01 12:32:01 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Cyril Deguet <asmax@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "audio_output.h"
-#include "aout_pcm.h"
-
-/* Biggest difference allowed between scheduled playing date and actual date 
-   (in microseconds) */
-#define MAX_DELTA 50000
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static void FillBuffer( aout_thread_t * p_aout, aout_fifo_t * p_fifo );
-static int  NextFrame ( aout_thread_t * p_aout, aout_fifo_t * p_fifo,
-                        mtime_t aout_date );
-
- /*****************************************************************************
- * Functions
- *****************************************************************************/
-void aout_PCMThread( aout_thread_t * p_aout )
-{
-    int i_fifo;
-    int i_buffer, i_buffer_limit, i_units = 0;
-
-#if defined(WIN32)
-    if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL) )
-        msg_Warn( p_aout, "could not change priority of aout_PCMThread()" );
-#endif
-
-    /* As the s32_buffer was created with calloc(), we don't have to set this
-     * memory to zero and we can immediately jump into the thread's loop */
-    while ( ! p_aout->b_die )
-    {
-        vlc_mutex_lock( &p_aout->fifos_lock );
-        for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
-        {
-            if( p_aout->fifo[i_fifo].b_die )
-            {
-                aout_FreeFifo( &p_aout->fifo[i_fifo] );
-            }
-            else
-            {
-                FillBuffer( p_aout, &p_aout->fifo[i_fifo] );
-            }
-        }
-        vlc_mutex_unlock( &p_aout->fifos_lock );
-
-        i_buffer_limit = p_aout->i_units * p_aout->i_channels;
-
-        switch ( p_aout->i_format )
-        {
-        case AOUT_FMT_U8:
-            for ( i_buffer = 0; i_buffer < i_buffer_limit; i_buffer++ )
-            {
-                ((u8*)p_aout->buffer)[i_buffer] = (u8)(
-                  (p_aout->s32_buffer[i_buffer] / AOUT_MAX_FIFOS / 256 + 128)
-                     * p_aout->i_volume / 256);
-                 p_aout->s32_buffer[i_buffer] = 0;
-            }
-            break;
-
-        case AOUT_FMT_S8:
-            for ( i_buffer = 0; i_buffer < i_buffer_limit; i_buffer++ )
-            {
-                ((s8*)p_aout->buffer)[i_buffer] = (s8)(
-                  p_aout->s32_buffer[i_buffer] / AOUT_MAX_FIFOS / 256
-                     * p_aout->i_volume / 256);
-                 p_aout->s32_buffer[i_buffer] = 0;
-            }
-            break;
-
-        case AOUT_FMT_U16_LE:
-        case AOUT_FMT_U16_BE:
-            for ( i_buffer = 0; i_buffer < i_buffer_limit; i_buffer++ )
-            {
-                ((u16*)p_aout->buffer)[i_buffer] = (u16)(
-                  (p_aout->s32_buffer[i_buffer] / AOUT_MAX_FIFOS + 128)
-                     * p_aout->i_volume / 256);
-                 p_aout->s32_buffer[i_buffer] = 0;
-            }
-            break;
-
-        case AOUT_FMT_S16_LE:
-        case AOUT_FMT_S16_BE:
-            for ( i_buffer = 0; i_buffer < i_buffer_limit; i_buffer++ )
-            {
-                ((s16*)p_aout->buffer)[i_buffer] = (s16)(
-                  p_aout->s32_buffer[i_buffer] / AOUT_MAX_FIFOS
-                     * p_aout->i_volume / 256);
-                 p_aout->s32_buffer[i_buffer] = 0;
-            }
-            break;
-        }
-
-        switch ( p_aout->i_format )
-        {
-        case AOUT_FMT_U8:
-        case AOUT_FMT_S8:
-            i_units = p_aout->pf_getbufinfo( p_aout, i_buffer_limit );
-
-            p_aout->date = mdate() + ((((mtime_t)((i_units +
-                p_aout->i_latency) / p_aout->i_channels)) * 1000000) /
-                ((mtime_t)p_aout->i_rate)) + p_aout->p_vlc->i_desync;
-
-            p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer,
-                             i_buffer_limit );
-            break;
-
-        case AOUT_FMT_U16_LE:
-        case AOUT_FMT_U16_BE:
-        case AOUT_FMT_S16_LE:
-        case AOUT_FMT_S16_BE:
-            i_units = p_aout->pf_getbufinfo( p_aout, i_buffer_limit * 2 ) / 2;
-
-            p_aout->date = mdate() + ((((mtime_t)((i_units +
-                p_aout->i_latency / 2) / p_aout->i_channels)) * 1000000) /
-                ((mtime_t)p_aout->i_rate)) + p_aout->p_vlc->i_desync;
-
-            p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer,
-                             i_buffer_limit * 2 );
-            break;
-        }
-
-        /* Sleep until there is only AOUT_BUFFER_DURATION/2 worth of audio
-         * left to play in the aout plugin, then we can start refill the
-         * plugin's buffer */
-        if( i_units > (i_buffer_limit/2) )
-            msleep( (i_units - i_buffer_limit/2) * AOUT_BUFFER_DURATION
-                    / i_buffer_limit );
-    }
-
-    vlc_mutex_lock( &p_aout->fifos_lock );
-    for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
-    {
-        aout_FreeFifo( &p_aout->fifo[i_fifo] );
-    }
-    vlc_mutex_unlock( &p_aout->fifos_lock );
-}
-
-/* Following functions are local */
-
-/*****************************************************************************
- * InitializeIncrement: change i_x/i_y to i_a+i_b/i_c
- *****************************************************************************/
-static inline void InitializeIncrement( aout_increment_t *p_inc,
-                                        int i_x, int i_y )
-{
-    p_inc->i_r = -i_y;
-    p_inc->i_a = 0;
-
-    while ( i_x >= i_y )
-    {
-        p_inc->i_a++;
-        i_x -= i_y;
-    }
-
-    p_inc->i_b = i_x;
-    p_inc->i_c = i_y;
-}
-
-/*****************************************************************************
- * UpdateIncrement
- *****************************************************************************/
-static inline void UpdateIncrement( aout_increment_t *p_inc, int *pi_integer )
-{
-    if( (p_inc->i_r += p_inc->i_b) >= 0 )
-    {
-        *pi_integer += p_inc->i_a + 1;
-        p_inc->i_r -= p_inc->i_c;
-    }
-    else
-    {
-        *pi_integer += p_inc->i_a;
-    }
-}
-
-/*****************************************************************************
- * FillBuffer: Read data from decoder fifo, and put it in S32_buffer
- *****************************************************************************/
-static void FillBuffer( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
-{
-    int i_buffer = 0;
-    int i_buffer_limit, i_units;
-
-    switch ( p_fifo->i_format )
-    {
-    case AOUT_FIFO_PCM:
-
-        i_units = p_aout->i_units;
-
-        /* While there are empty frames in the buffer, fill them */
-        while ( i_units > 0 )
-        {
-            /* If there is no next frame, wait for one */
-            if( !p_fifo->b_next_frame )
-            {
-                if( NextFrame(p_aout, p_fifo, p_aout->date + 
-                        ((((mtime_t)(i_buffer >> 1)) * 1000000) / 
-                        ((mtime_t)p_aout->i_rate))) )
-                {
-                    break;
-                }
-            }
-
-            i_buffer_limit = p_aout->i_units * p_aout->i_channels;
-
-            while ( i_buffer < i_buffer_limit )
-            {
-                /* FIXME: make this more generic */
-                if( p_aout->i_channels == 2 )
-                {
-                    p_aout->s32_buffer[i_buffer++] +=
-                        (s32)( ((s16 *)p_fifo->buffer)[2*p_fifo->i_unit] );
-                    p_aout->s32_buffer[i_buffer++] +=
-                        (s32)( ((s16 *)p_fifo->buffer)[2*p_fifo->i_unit+1] );
-                }
-                else if( p_aout->i_channels == 1 )
-                {
-                    p_aout->s32_buffer[i_buffer++] +=
-                        (s32)( ((s16 *)p_fifo->buffer)[p_fifo->i_unit] );
-                }
-                else
-                {
-                    msg_Err( p_aout, "unsupported number of channels" );
-                }
-
-                UpdateIncrement(&p_fifo->unit_increment, &p_fifo->i_unit);
-
-                if( p_fifo->i_unit >= p_fifo->i_unit_limit )
-                {
-                    p_fifo->i_unit -= p_fifo->i_unit_limit;
-                }
-            }
-            if( p_fifo->i_units > i_units )
-            {
-                p_fifo->i_units -= i_units;
-                break;
-            }
-            else
-            {
-                i_units -= p_fifo->i_units;
-
-                vlc_mutex_lock( &p_fifo->data_lock );
-                p_fifo->i_start_frame = p_fifo->i_next_frame;
-             /* p_fifo->b_start_frame = 1; */
-                p_fifo->i_next_frame = AOUT_FIFO_INC( p_fifo->i_next_frame );
-                p_fifo->b_next_frame = 0;
-                vlc_cond_signal( &p_fifo->data_wait );
-                vlc_mutex_unlock( &p_fifo->data_lock );
-
-            }
-        }
-        break;
-
-    default:
-        break;
-    }
-}
-
-static int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo,
-                      mtime_t aout_date )
-{
-    int i_units, i_units_dist, i_rate;
-    mtime_t i_delta;    
-
-    /* We take the lock */
-    vlc_mutex_lock( &p_fifo->data_lock );
-    if ( p_fifo->b_die )
-    {
-        vlc_mutex_unlock( &p_fifo->data_lock );
-        return( -1 );
-    }
-
-    /* Are we looking for a dated start frame ? */
-    if ( !p_fifo->b_start_frame )
-    {
-        while ( p_fifo->i_start_frame != p_fifo->i_end_frame )
-        {
-            if ( p_fifo->date[p_fifo->i_start_frame] != LAST_MDATE )
-            {
-                p_fifo->b_start_frame = 1;
-                p_fifo->i_next_frame = AOUT_FIFO_INC( p_fifo->i_start_frame );
-                p_fifo->i_unit = p_fifo->i_start_frame * 
-                        (p_fifo->i_frame_size / p_fifo->i_channels);
-                break;
-            }
-            p_fifo->i_start_frame = AOUT_FIFO_INC( p_fifo->i_start_frame );
-        }
-
-        if ( p_fifo->i_start_frame == p_fifo->i_end_frame )
-        {
-            vlc_mutex_unlock( &p_fifo->data_lock );
-            return( -1 );
-        }
-    }
-
-    /* We are looking for the next dated frame */
-    /* FIXME : is the output fifo full ?? -- pretty unlikely given its size */
-    while ( !p_fifo->b_next_frame )
-    {
-        while ( p_fifo->i_next_frame != p_fifo->i_end_frame )
-        {
-            if ( p_fifo->date[p_fifo->i_next_frame] != LAST_MDATE )
-            {
-                p_fifo->b_next_frame = 1;
-                break;
-            }
-            p_fifo->i_next_frame = AOUT_FIFO_INC( p_fifo->i_next_frame );
-        }
-
-        while ( p_fifo->i_next_frame == p_fifo->i_end_frame )
-        {
-            vlc_cond_wait( &p_fifo->data_wait, &p_fifo->data_lock );
-            if ( p_fifo->b_die )
-            {
-                vlc_mutex_unlock( &p_fifo->data_lock );
-                return( -1 );
-            }
-        }
-    }
-
-    i_units = ((p_fifo->i_next_frame - p_fifo->i_start_frame) & AOUT_FIFO_SIZE)
-               * (p_fifo->i_frame_size / p_fifo->i_channels);
-
-    i_delta = aout_date - p_fifo->date[p_fifo->i_start_frame];
-
-    /* Resample if delta is too long */
-    if( abs(i_delta) > MAX_DELTA )
-    {
-        i_rate = p_fifo->i_rate + (i_delta / 256);
-    }
-    else
-    {
-        i_rate = p_fifo->i_rate;
-    }
-
-    InitializeIncrement( &p_fifo->unit_increment, i_rate, p_aout->i_rate );
-
-    /* Calculate how many units we're going to write */
-    i_units_dist = p_fifo->i_unit - p_fifo->i_start_frame
-                                * (p_fifo->i_frame_size / p_fifo->i_channels);
-
-    /* Manage the fifo wrapping */
-    if( i_units_dist > p_fifo->i_unit_limit / 2 )
-    {
-        i_units -= (i_units_dist - p_fifo->i_unit_limit);
-    }
-    else if( i_units_dist < - p_fifo->i_unit_limit / 2 )
-    {
-        i_units -= (i_units_dist + p_fifo->i_unit_limit);
-    }
-    else
-    {
-        i_units -= i_units_dist;
-    }
-
-    p_fifo->i_units = 1 + ( i_units * p_aout->i_rate / i_rate );
-
-    /* We release the lock before leaving */
-    vlc_mutex_unlock( &p_fifo->data_lock );
-    return( 0 );
-}
-
diff --git a/src/audio_output/aout_pcm.h b/src/audio_output/aout_pcm.h
deleted file mode 100644 (file)
index 4571685..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*****************************************************************************
- * aout_pcm.h: PCM audio output functions
- *****************************************************************************
- * Copyright (C) 1999-2002 VideoLAN
- * $Id: aout_pcm.h,v 1.1 2002/02/24 22:06:50 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Cyril Deguet <asmax@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-void aout_PCMThread( aout_thread_t * p_aout );
-
diff --git a/src/audio_output/aout_spdif.c b/src/audio_output/aout_spdif.c
deleted file mode 100644 (file)
index 686d8d5..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*****************************************************************************
- * aout_spdif.c: A52 passthrough output
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.30 2002/08/04 17:23:44 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Stéphane Borel <stef@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
-#include <string.h>                                              /* memset() */
-
-#include <vlc/vlc.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
-#include "audio_output.h"
-#include "aout_spdif.h"
-
-/****************************************************************************
- * iec958_build_burst: builds an iec958/spdif frame
- ****************************************************************************/
-void iec958_build_burst( u8 * p_buf, aout_fifo_t * p_fifo )
-{
-    const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
-    int      i_length  = p_fifo->i_frame_size;
-#ifndef HAVE_SWAB
-    /* Skip the first byte if i_length is odd */
-    u16 * p_in  = (u16 *)( p_fifo->buffer + ( i_length & 0x1 ) );
-    u16 * p_out = (u16 *)p_buf;
-#endif
-
-    /* Add the spdif headers */
-    memcpy( p_buf, p_sync, 6 );
-    p_buf[6] = ( i_length * 8 ) & 0xFF;
-    p_buf[7] = ( ( i_length * 8 ) >> 8 ) & 0xFF;
-
-#ifdef HAVE_SWAB
-    swab( p_fifo->buffer + p_fifo->i_start_frame * i_length,
-          p_buf + 8, i_length );
-#else
-    /* i_length should be even */
-    i_length &= ~0x1;
-
-    while( i_length )
-    {
-        *p_out = ( (*p_in & 0x00ff) << 16 ) | ( (*p_in & 0xff00) >> 16 );
-        p_in++;
-        p_out++;
-        i_length -= 2;
-    }
-#endif
-
-    /* Add zeroes to complete the spdif frame,
-     * they will be ignored by the decoder */
-    memset( p_buf + 8 + i_length, 0, SPDIF_FRAME_SIZE - 8 - i_length );
-}
-
-
-/*****************************************************************************
- * aout_SpdifThread: audio output thread that sends raw spdif data
- *                   to an external decoder
- *****************************************************************************
- * This output thread is quite specific as it can only handle one fifo now.
- *
- * Note: spdif can demux up to 8 A52 streams, and can even take
- * care of time stamps (cf A52 spec) but I'm not sure all decoders
- * implement it.
- *****************************************************************************/
-void aout_SpdifThread( aout_thread_t * p_aout )
-{
-    int         i_fifo;
-    mtime_t     m_frame_time = 0;
-    mtime_t     m_play;
-    mtime_t     m_old;
-
-    while( !p_aout->b_die )
-    {
-        i_fifo = 0;
-        /* Find spdif fifo */
-        while( ( p_aout->fifo[i_fifo].i_format != AOUT_FIFO_SPDIF ) &&
-               ( i_fifo < AOUT_MAX_FIFOS ) && !p_aout->b_die )
-        {
-            i_fifo++;
-        }
-
-        m_old = 0;
-
-        while( !p_aout->b_die && 
-               !p_aout->fifo[i_fifo].b_die )
-        {
-            vlc_mutex_lock( &p_aout->fifo[i_fifo].data_lock );
-            if( !AOUT_FIFO_ISEMPTY( p_aout->fifo[i_fifo] ) )
-            {
-                /* Copy data from fifo to buffer to release the
-                 * lock earlier */
-                iec958_build_burst( p_aout->buffer,
-                                    &p_aout->fifo[i_fifo] );
-
-                m_play = p_aout->fifo[i_fifo].date[p_aout->fifo[i_fifo].
-                             i_start_frame];
-
-                p_aout->fifo[i_fifo].i_start_frame =
-                    (p_aout->fifo[i_fifo].i_start_frame + 1 )
-                    & AOUT_FIFO_SIZE;
-
-                /* Compute the theorical duration of an A52 frame */
-                m_frame_time = 1000000 * A52_FRAME_SIZE
-                                       / p_aout->fifo[i_fifo].i_rate;
-
-                vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
-
-                /* Play spdif frame to the external decoder 
-                 * the kernel driver will sleep until the
-                 * dsp buffer is empty enough to accept the data */
-                if( m_play > ( mdate() - m_frame_time ) )
-                {
-                    /* check continuity */
-                    if( (m_play - m_old) != m_frame_time )
-                    {
-                        mwait( m_play - m_frame_time );
-                    }
-                    else
-                    {
-                        mwait( m_play - 2 * m_frame_time );
-                    }
-                    m_old = m_play;
-                    
-                    p_aout->pf_getbufinfo( p_aout, 0 );
-
-                    p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer,
-                                     SPDIF_FRAME_SIZE );
-                }
-            }
-            else
-            {
-                msg_Warn( p_aout, "empty spdif fifo" );
-                while( AOUT_FIFO_ISEMPTY( p_aout->fifo[i_fifo] ) &&
-                       !p_aout->b_die && 
-                       !p_aout->fifo[i_fifo].b_die )
-
-                {
-                    vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
-                    msleep( m_frame_time );
-                    vlc_mutex_lock( &p_aout->fifo[i_fifo].data_lock );
-                }
-                vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
-            }
-        }
-
-        vlc_mutex_lock( &p_aout->fifos_lock );
-        aout_FreeFifo( &p_aout->fifo[i_fifo] );
-        vlc_mutex_unlock( &p_aout->fifos_lock );
-    }
-
-    return;
-}
-
diff --git a/src/audio_output/aout_spdif.h b/src/audio_output/aout_spdif.h
deleted file mode 100644 (file)
index ca123a8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*****************************************************************************
- * aout_spdif.h: A52 passthrough output
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.h,v 1.2 2002/08/04 17:23:44 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Stéphane Borel <stef@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-void aout_SpdifThread ( aout_thread_t * p_aout );
-
index 649fd945288e7f446112a3ade2c190f11c32ee25..3f0e4b02faa0bdde7ad7adb71c877a3d9f346110 100644 (file)
@@ -1,11 +1,10 @@
 /*****************************************************************************
- * audio_output.c : audio output thread
+ * audio_output.c : audio output instance
  *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: audio_output.c,v 1.89 2002/08/04 20:04:11 sam Exp $
+ * Copyright (C) 2002 VideoLAN
+ * $Id: audio_output.c,v 1.90 2002/08/07 21:36:56 massiot Exp $
  *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Cyril Deguet <asmax@via.ecp.fr>
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include <vlc/vlc.h>
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>                                           /* getpid() */
-#endif
-
-#ifdef WIN32                   /* getpid() for win32 is located in process.h */
-#   include <process.h>
+#ifdef HAVE_ALLOCA_H
+#   include <alloca.h>
 #endif
 
 #include "audio_output.h"
-
-#include "aout_pcm.h"
-#include "aout_spdif.h"
+#include "aout_internal.h"
 
 /*****************************************************************************
- * Local prototypes
+ * aout_NewInstance: initialize aout structure
  *****************************************************************************/
-static int  aout_SpawnThread ( aout_thread_t * p_aout );
-
-/*****************************************************************************
- * aout_CreateThread: initialize audio thread
- *****************************************************************************/
-aout_thread_t *aout_CreateThread( vlc_object_t *p_parent,
-                                  int i_channels, int i_rate )
+aout_instance_t * __aout_NewInstance( vlc_object_t * p_parent )
 {
-    aout_thread_t * p_aout;                             /* thread descriptor */
-    int             i_format;
+    aout_instance_t * p_aout;
 
-    /* Allocate descriptor */
+    /* Allocate descriptor. */
     p_aout = vlc_object_create( p_parent, VLC_OBJECT_AOUT );
     if( p_aout == NULL )
     {
         return NULL;
     }
 
-    p_aout->i_latency = 0;
-    p_aout->i_rate = config_GetInt( p_aout, "rate" );
-    p_aout->i_channels = config_GetInt( p_aout, "mono" ) ? 1 : 2;
-
-    i_format = config_GetInt( p_aout, "audio-format" );
-    if( ( !i_format ) || ( i_format > 8 ) )
-    {
-        p_aout->i_format = AOUT_FMT_S16_NE;
-    }
-    else
-    {
-        p_aout->i_format = 1 << ( i_format + 2 );
-    }
-
-    if( p_aout->i_rate == 0 )
-    {
-        msg_Err( p_aout, "null sample rate" );
-        vlc_object_destroy( p_aout );
-        return NULL;
-    }
-
-    /* Choose the best module */
-    p_aout->p_module = module_Need( p_aout, "audio output", "$aout" );
-    if( p_aout->p_module == NULL )
-    {
-        msg_Err( p_aout, "no suitable aout module" );
-        vlc_object_destroy( p_aout );
-        return NULL;
-    }
-
-    /*
-     * Initialize audio device
-     */
-    if ( p_aout->pf_setformat( p_aout ) )
-    {
-        module_Unneed( p_aout, p_aout->p_module );
-        vlc_object_destroy( p_aout );
-        return NULL;
-    }
+    /* Initialize members. */
+    vlc_mutex_init( p_parent, &p_aout->input_lock );
+    vlc_cond_init( p_parent, &p_aout->input_signal );
+    p_aout->i_inputs_active = 0;
+    p_aout->b_change_requested = 0;
+    p_aout->i_nb_inputs = 0;
 
-    /* Initialize the volume level */
-    p_aout->i_volume = config_GetInt( p_aout, "volume" );
-    p_aout->i_savedvolume = 0;
-    
-    /* FIXME: maybe it would be cleaner to change SpawnThread prototype
-     * see vout to handle status correctly ?? however, it is not critical since
-     * this thread is only called in main and all calls are blocking */
-    if( aout_SpawnThread( p_aout ) )
-    {
-        module_Unneed( p_aout, p_aout->p_module );
-        vlc_object_destroy( p_aout );
-        return NULL;
-    }
+    vlc_mutex_init( p_parent, &p_aout->mixer_lock );
+    vlc_cond_init( p_parent, &p_aout->mixer_signal );
+    p_aout->b_mixer_active = 0;
 
     vlc_object_attach( p_aout, p_parent->p_vlc );
 
@@ -124,135 +67,132 @@ aout_thread_t *aout_CreateThread( vlc_object_t *p_parent,
 }
 
 /*****************************************************************************
- * aout_SpawnThread
+ * aout_DeleteInstance: destroy aout structure
+ *****************************************************************************/
+void aout_DeleteInstance( aout_instance_t * p_aout )
+{
+    vlc_mutex_destroy( &p_aout->input_lock );
+    vlc_cond_destroy( &p_aout->input_signal );
+    vlc_mutex_destroy( &p_aout->mixer_lock );
+    vlc_cond_destroy( &p_aout->mixer_signal );
+
+    /* Free structure. */
+    vlc_object_detach_all( p_aout );
+    vlc_object_destroy( p_aout );
+}
+
+/*****************************************************************************
+ * aout_BufferNew : ask for a new empty buffer
  *****************************************************************************/
-static int aout_SpawnThread( aout_thread_t * p_aout )
+aout_buffer_t * aout_BufferNew( aout_instance_t * p_aout,
+                                aout_input_t * p_input,
+                                size_t i_nb_samples )
 {
-    int     i_index, i_bytes;
-    void (* pf_aout_thread)( aout_thread_t * ) = NULL;
-    char   *psz_format;
+    aout_buffer_t * p_buffer;
 
-    /* Initialize the fifos lock */
-    vlc_mutex_init( p_aout, &p_aout->fifos_lock );
+    /* This necessarily allocates in the heap. */
+    aout_BufferAlloc( &p_input->input_alloc, (u64)(1000000 * i_nb_samples)
+                                         / p_input->input.i_rate,
+                      NULL, p_buffer );
+    p_buffer->i_nb_samples = i_nb_samples;
 
-    /* Initialize audio fifos : set all fifos as empty and initialize locks */
-    for ( i_index = 0; i_index < AOUT_MAX_FIFOS; i_index++ )
+    if ( p_buffer == NULL )
     {
-        p_aout->fifo[i_index].i_format = AOUT_FIFO_NONE;
-        vlc_mutex_init( p_aout, &p_aout->fifo[i_index].data_lock );
-        vlc_cond_init( p_aout, &p_aout->fifo[i_index].data_wait );
+        msg_Err( p_aout, "NULL buffer !" );
     }
-
-    /* Compute the size (in audio units) of the audio output buffer. Although
-     * AOUT_BUFFER_DURATION is given in microseconds, the output rate is given
-     * in Hz, that's why we need to divide by 10^6 microseconds (1 second) */
-    p_aout->i_units = (s64)p_aout->i_rate * AOUT_BUFFER_DURATION / 1000000;
-
-    /* Make pf_aout_thread point to the right thread function, and compute the
-     * byte size of the audio output buffer */
-    switch ( p_aout->i_format )
+    else
     {
-        case AOUT_FMT_U8:
-            pf_aout_thread = aout_PCMThread;
-            psz_format = "unsigned 8 bits";
-            i_bytes = p_aout->i_units * p_aout->i_channels;
-            break;
-
-        case AOUT_FMT_S8:
-            pf_aout_thread = aout_PCMThread;
-            psz_format = "signed 8 bits";
-            i_bytes = p_aout->i_units * p_aout->i_channels;
-            break;
-
-        case AOUT_FMT_U16_LE:
-        case AOUT_FMT_U16_BE:
-            pf_aout_thread = aout_PCMThread;
-            psz_format = "unsigned 16 bits";
-            i_bytes = 2 * p_aout->i_units * p_aout->i_channels;
-            break;
+        p_buffer->start_date = p_buffer->end_date = 0;
+    }
 
-        case AOUT_FMT_S16_LE:
-        case AOUT_FMT_S16_BE:
-            pf_aout_thread = aout_PCMThread;
-            psz_format = "signed 16 bits";
-            i_bytes = 2 * p_aout->i_units * p_aout->i_channels;
-            break;
+    return p_buffer;
+}
 
-        case AOUT_FMT_A52:
-            pf_aout_thread = aout_SpdifThread;
-            psz_format = "A52 pass-through";
-            i_bytes = SPDIF_FRAME_SIZE;
-            break;
+/*****************************************************************************
+ * aout_BufferDelete : destroy an undecoded buffer
+ *****************************************************************************/
+void aout_BufferDelete( aout_instance_t * p_aout, aout_input_t * p_input,
+                        aout_buffer_t * p_buffer )
+{
+    aout_BufferFree( p_buffer );
+}
 
-        default:
-            msg_Err( p_aout, "unknown audio output format %i",
-                             p_aout->i_format );
-            return( -1 );
-    }
+/*****************************************************************************
+ * aout_BufferPlay : filter & mix the decoded buffer
+ *****************************************************************************/
+void aout_BufferPlay( aout_instance_t * p_aout, aout_input_t * p_input,
+                      aout_buffer_t * p_buffer )
+{
+    vlc_bool_t b_run_mixer = 0;
 
-    /* Allocate the memory needed by the audio output buffers, and set to zero
-     * the s32 buffer's memory */
-    p_aout->buffer = malloc( i_bytes );
-    if ( p_aout->buffer == NULL )
+    if ( p_buffer->start_date == 0 )
     {
-        msg_Err( p_aout, "out of memory" );
-        return( -1 );
+        msg_Warn( p_aout, "non-dated buffer received" );
+        aout_BufferFree( p_buffer );
     }
-
-    p_aout->s32_buffer = (s32 *)calloc( p_aout->i_units,
-                                        sizeof(s32) * p_aout->i_channels );
-    if ( p_aout->s32_buffer == NULL )
+    else
     {
-        msg_Err( p_aout, "out of memory" );
-        free( p_aout->buffer );
-        return( -1 );
+        p_buffer->end_date = p_buffer->start_date
+                                + (mtime_t)(p_buffer->i_nb_samples * 1000000)
+                                    / p_input->input.i_rate;
     }
 
-    /* Rough estimate of the playing date */
-    p_aout->date = mdate() + p_aout->p_vlc->i_desync;
+    aout_InputPlay( p_aout, p_input, p_buffer );
 
-    /* Launch the thread */
-    if ( vlc_thread_create( p_aout, "audio output", pf_aout_thread, 0 ) )
+    /* Run the mixer if it is able to run. */
+    vlc_mutex_lock( &p_aout->mixer_lock );
+    if ( !p_aout->b_mixer_active )
     {
-        msg_Err( p_aout, "cannot spawn audio output thread" );
-        free( p_aout->buffer );
-        free( p_aout->s32_buffer );
-        return( -1 );
+        p_aout->b_mixer_active = 1;
+        b_run_mixer = 1;
     }
+    vlc_mutex_unlock( &p_aout->mixer_lock );
 
-    msg_Dbg( p_aout, "%s thread spawned, %i channels, rate %i",
-                     psz_format, p_aout->i_channels, p_aout->i_rate );
-    return( 0 );
+    if ( b_run_mixer )
+    {
+        aout_MixerRun( p_aout );
+        vlc_mutex_lock( &p_aout->mixer_lock );
+        p_aout->b_mixer_active = 0;
+        vlc_cond_broadcast( &p_aout->mixer_signal );
+        vlc_mutex_unlock( &p_aout->mixer_lock );
+    }
 }
 
 /*****************************************************************************
- * aout_DestroyThread
+ * aout_FormatToBytes : return the number bytes/sample for format
+ * (didn't know where else to put it)
  *****************************************************************************/
-void aout_DestroyThread( aout_thread_t * p_aout )
+int aout_FormatToBytes( audio_sample_format_t * p_format )
 {
-    int i_index;
-    
-    /* Ask thread to kill itself and wait until it's done */
-    p_aout->b_die = 1;
+    int i_result;
 
-    vlc_thread_join( p_aout );
-
-    /* Free the allocated memory */
-    free( p_aout->buffer );
-    free( p_aout->s32_buffer );
-
-    /* Destroy the condition and mutex locks */
-    for ( i_index = 0; i_index < AOUT_MAX_FIFOS; i_index++ )
+    switch ( p_format->i_format )
     {
-        vlc_mutex_destroy( &p_aout->fifo[i_index].data_lock );
-        vlc_cond_destroy( &p_aout->fifo[i_index].data_wait );
+    case AOUT_FMT_U8:
+    case AOUT_FMT_S8:
+        i_result = 1;
+        break;
+
+    case AOUT_FMT_U16_LE:
+    case AOUT_FMT_U16_BE:
+    case AOUT_FMT_S16_LE:
+    case AOUT_FMT_S16_BE:
+        i_result = 2;
+        break;
+
+    case AOUT_FMT_FLOAT32:
+    case AOUT_FMT_FIXED32:
+        i_result = 4;
+        break;
+
+    case AOUT_FMT_A52:
+        i_result = 1; /* This is a bit special... sample == byte */
+        break;
+
+    default:
+        i_result = 0; /* will segfault much sooner... */
     }
-    vlc_mutex_destroy( &p_aout->fifos_lock );
-    
-    /* Release the aout module */
-    module_Unneed( p_aout, p_aout->p_module );
 
-    /* Free structure */
-    vlc_object_destroy( p_aout );
+    return i_result * p_format->i_channels;
 }
 
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
new file mode 100644 (file)
index 0000000..fe4f00a
--- /dev/null
@@ -0,0 +1,224 @@
+/*****************************************************************************
+ * filters.c : audio output filters management
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: filters.c,v 1.1 2002/08/07 21:36:56 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h>                            /* calloc(), malloc(), free() */
+#include <string.h>
+#ifdef HAVE_ALLOCA_H
+#   include <alloca.h> 
+#endif
+
+#include <vlc/vlc.h>
+
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * aout_FiltersCreatePipeline: create a filters pipeline to transform a sample
+ *                             format to another
+ *****************************************************************************
+ * TODO : allow the user to add/remove specific filters
+ *****************************************************************************/
+int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
+                                aout_filter_t ** pp_filters,
+                                int * pi_nb_filters,
+                                audio_sample_format_t * p_input_format,
+                                audio_sample_format_t * p_output_format )
+{
+    if ( AOUT_FMTS_IDENTICAL( p_input_format, p_output_format ) )
+    {
+        msg_Dbg( p_aout, "no need for any filter" );
+        *pi_nb_filters = 0;
+        return 0;
+    }
+
+    pp_filters[0] = vlc_object_create( p_aout, sizeof(aout_filter_t) );
+    if ( pp_filters[0] == NULL )
+    {
+        return -1;
+    }
+    vlc_object_attach( pp_filters[0], p_aout );
+
+    /* Try to find a filter to do the whole conversion. */
+    memcpy( &pp_filters[0]->input, p_input_format,
+            sizeof(audio_sample_format_t) );
+    memcpy( &pp_filters[0]->output, p_output_format,
+            sizeof(audio_sample_format_t) );
+    pp_filters[0]->p_module = module_Need( pp_filters[0], "audio filter",
+                                           NULL );
+    if ( pp_filters[0]->p_module != NULL )
+    {
+        msg_Dbg( p_aout, "found a filter for the whole conversion" );
+        *pi_nb_filters = 1;
+        return 0;
+    }
+
+    /* Split the conversion : format | rate, or rate | format. */
+    pp_filters[0]->output.i_format = pp_filters[0]->input.i_format;
+    pp_filters[0]->p_module = module_Need( pp_filters[0], "audio filter",
+                                           NULL );
+    if ( pp_filters[0]->p_module == NULL )
+    {
+        /* Then, start with the format conversion. */
+        memcpy( &pp_filters[0]->output, p_output_format,
+                sizeof(audio_sample_format_t) );
+        pp_filters[0]->output.i_rate = pp_filters[0]->input.i_rate;
+        pp_filters[0]->p_module = module_Need( pp_filters[0], "audio filter",
+                                               NULL );
+        if ( pp_filters[0]->p_module == NULL )
+        {
+            msg_Err( p_aout, "couldn't find a filter for any conversion" );
+            vlc_object_detach_all( pp_filters[0] );
+            vlc_object_destroy( pp_filters[0] );
+            return -1;
+        }
+    }
+
+    /* Find a filter for the rest. */
+    pp_filters[1] = vlc_object_create( p_aout, sizeof(aout_filter_t) );
+    if ( pp_filters[1] == NULL )
+    {
+        vlc_object_detach_all( pp_filters[0] );
+        vlc_object_destroy( pp_filters[0] );
+        return -1;
+    }
+    vlc_object_attach( pp_filters[1], p_aout );
+
+    memcpy( &pp_filters[1]->input, &pp_filters[0]->output,
+            sizeof(audio_sample_format_t) );
+    memcpy( &pp_filters[1]->output, p_output_format,
+            sizeof(audio_sample_format_t) );
+    pp_filters[1]->p_module = module_Need( pp_filters[1], "audio filter",
+                                           NULL );
+    if ( pp_filters[1]->p_module == NULL )
+    {
+        msg_Err( p_aout,
+                 "couldn't find a filter for the 2nd part of the conversion" );
+        vlc_object_detach_all( pp_filters[0] );
+        vlc_object_destroy( pp_filters[0] );
+        vlc_object_detach_all( pp_filters[1] );
+        vlc_object_destroy( pp_filters[1] );
+        return -1;
+    }
+
+    msg_Dbg( p_aout, "filter pipeline made of two filters" );
+    *pi_nb_filters = 2;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * aout_FiltersDestroyPipeline: deallocate a filters pipeline
+ *****************************************************************************/
+void aout_FiltersDestroyPipeline( aout_instance_t * p_aout,
+                                  aout_filter_t ** pp_filters,
+                                  int i_nb_filters )
+{
+    int i;
+
+    for ( i = 0; i < i_nb_filters; i++ )
+    {
+        module_Unneed( pp_filters[i], pp_filters[i]->p_module );
+        vlc_object_detach_all( pp_filters[i] );
+        vlc_object_destroy( pp_filters[i] );
+    }
+}
+
+/*****************************************************************************
+ * aout_FiltersHintBuffers: fill in aout_alloc_t structures to optimize
+ *                          buffer allocations
+ *****************************************************************************/
+void aout_FiltersHintBuffers( aout_instance_t * p_aout,
+                              aout_filter_t ** pp_filters,
+                              int i_nb_filters, aout_alloc_t * p_first_alloc )
+{
+    int i;
+
+    for ( i = i_nb_filters - 1; i >= 0; i-- )
+    {
+        aout_filter_t * p_filter = pp_filters[i];
+
+        int i_output_size = aout_FormatToBytes( &p_filter->output )
+                             * p_filter->output.i_rate;
+        int i_input_size = aout_FormatToBytes( &p_filter->input )
+                             * p_filter->input.i_rate;
+
+        p_first_alloc->i_bytes_per_sec = __MAX( p_first_alloc->i_bytes_per_sec,
+                                                i_output_size );
+
+        if ( p_filter->b_in_place )
+        {
+            p_first_alloc->i_bytes_per_sec = __MAX(
+                                         p_first_alloc->i_bytes_per_sec,
+                                         i_input_size );
+        }
+        else
+        {
+            /* We're gonna need a buffer allocation. */
+            memcpy( &p_filter->output_alloc, p_first_alloc,
+                    sizeof(aout_alloc_t) );
+            p_first_alloc->i_alloc_type = AOUT_ALLOC_STACK;
+            p_first_alloc->i_bytes_per_sec = i_input_size;
+        }
+    }
+}
+
+/*****************************************************************************
+ * aout_FiltersPlay: play a buffer
+ *****************************************************************************/
+void aout_FiltersPlay( aout_instance_t * p_aout,
+                       aout_filter_t ** pp_filters,
+                       int i_nb_filters, aout_buffer_t ** pp_input_buffer )
+{
+    int i;
+
+    for ( i = 0; i < i_nb_filters; i++ )
+    {
+        aout_filter_t * p_filter = pp_filters[i];
+        aout_buffer_t * p_output_buffer;
+
+        aout_BufferAlloc( &p_filter->output_alloc,
+                          (u64)((*pp_input_buffer)->i_nb_samples * 1000000)
+                            / p_filter->output.i_rate, *pp_input_buffer,
+                          p_output_buffer );
+        if ( p_output_buffer == NULL )
+        {
+            msg_Err( p_aout, "out of memory" );
+            return;
+        }
+        /* Please note that p_output_buffer->i_nb_samples shall be set by
+         * the filter plug-in. */
+
+        p_filter->pf_do_work( p_aout, p_filter, *pp_input_buffer,
+                              p_output_buffer );
+
+        if ( !p_filter->b_in_place )
+        {
+            aout_BufferFree( *pp_input_buffer );
+            *pp_input_buffer = p_output_buffer;
+        }
+    }
+}
+
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
new file mode 100644 (file)
index 0000000..a78b39a
--- /dev/null
@@ -0,0 +1,228 @@
+/*****************************************************************************
+ * input.c : internal management of input streams for the audio output
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: input.c,v 1.1 2002/08/07 21:36:56 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h>                            /* calloc(), malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * aout_InputNew : allocate a new input and rework the filter pipeline
+ *****************************************************************************/
+static aout_input_t * InputNew( aout_instance_t * p_aout,
+                                audio_sample_format_t * p_format )
+{
+    aout_input_t *  p_input = malloc(sizeof(aout_input_t));
+
+    if ( p_input == NULL ) return NULL;
+
+    vlc_mutex_lock( &p_aout->mixer_lock );
+    while ( p_aout->b_mixer_active )
+    {
+        vlc_cond_wait( &p_aout->mixer_signal, &p_aout->mixer_lock );
+    }
+
+    if ( p_aout->i_nb_inputs == 0 )
+    {
+        /* Recreate the output using the new format. */
+        if ( aout_OutputNew( p_aout, p_format ) < 0 )
+        {
+            free( p_input );
+            return NULL;
+        }
+    }
+    else
+    {
+        aout_MixerDelete( p_aout );
+    }
+
+    memcpy( &p_input->input, p_format,
+            sizeof(audio_sample_format_t) );
+
+    /* Prepare FIFO. */
+    aout_FifoInit( p_aout, &p_input->fifo );
+    p_input->p_first_byte_to_mix = NULL;
+
+    /* Create filters. */
+    if ( aout_FiltersCreatePipeline( p_aout, p_input->pp_filters,
+                                     &p_input->i_nb_filters, &p_input->input,
+                                     &p_aout->mixer.input ) < 0 )
+    {
+        msg_Err( p_aout, "couldn't set an input pipeline" );
+
+        aout_FifoDestroy( p_aout, &p_input->fifo );
+
+        free( p_input );
+
+        if ( !p_aout->i_nb_inputs )
+        {
+            aout_OutputDelete( p_aout );
+        }
+        return NULL;
+    }
+
+    p_aout->pp_inputs[p_aout->i_nb_inputs] = p_input;
+    p_aout->i_nb_inputs++;
+
+    if ( aout_MixerNew( p_aout ) < 0 )
+    {
+        p_aout->i_nb_inputs--;
+        aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters,
+                                     p_input->i_nb_filters );
+        aout_FifoDestroy( p_aout, &p_input->fifo );
+
+        free( p_input );
+
+        if ( !p_aout->i_nb_inputs )
+        {
+            aout_OutputDelete( p_aout );
+        }   
+    }
+
+    /* Prepare hints for the buffer allocator. */
+    p_input->input_alloc.i_alloc_type = AOUT_ALLOC_HEAP;
+    p_input->input_alloc.i_bytes_per_sec = -1;
+
+    aout_FiltersHintBuffers( p_aout, p_input->pp_filters,
+                             p_input->i_nb_filters,
+                             &p_input->input_alloc );
+
+    /* i_bytes_per_sec is still == -1 if no filters */
+    p_input->input_alloc.i_bytes_per_sec = __MAX(
+                                    p_input->input_alloc.i_bytes_per_sec,
+                                    aout_FormatToBytes( &p_input->input )
+                                     * p_input->input.i_rate );
+    /* Allocate in the heap, it is more convenient for the decoder. */
+    p_input->input_alloc.i_alloc_type = AOUT_ALLOC_HEAP;
+
+    vlc_mutex_unlock( &p_aout->mixer_lock );
+
+    msg_Dbg( p_aout, "input 0x%x created", p_input );
+    return p_input;
+}
+
+aout_input_t * __aout_InputNew( vlc_object_t * p_this,
+                                aout_instance_t ** pp_aout,
+                                audio_sample_format_t * p_format )
+{
+    /* Create an audio output if there is none. */
+    *pp_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE );
+
+    if( *pp_aout == NULL )
+    {
+        msg_Dbg( p_this, "no aout present, spawning one" );
+
+        *pp_aout = aout_NewInstance( p_this );
+        /* Everything failed, I'm a loser, I just wanna die */
+        if( *pp_aout == NULL )
+        {
+            return NULL;
+        }
+    }
+    else
+    {
+        vlc_object_release( *pp_aout );
+    }
+
+    return InputNew( *pp_aout, p_format );
+}
+
+/*****************************************************************************
+ * aout_InputDelete : delete an input
+ *****************************************************************************/
+void aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input )
+{
+    int i_input;
+
+    msg_Dbg( p_aout, "input 0x%x destroyed", p_input );
+
+    vlc_mutex_lock( &p_aout->mixer_lock );
+    while ( p_aout->b_mixer_active )
+    {
+        vlc_cond_wait( &p_aout->mixer_signal, &p_aout->mixer_lock );
+    }
+
+    for ( i_input = 0; i_input < p_aout->i_nb_inputs; i_input++ )
+    {
+        if ( p_aout->pp_inputs[i_input] == p_input )
+        {
+            break;
+        }
+    }
+
+    if ( i_input == p_aout->i_nb_inputs )
+    {
+        msg_Err( p_aout, "cannot find an input to delete" );
+        return;
+    }
+
+    /* Remove the input from the list. */
+    memmove( &p_aout->pp_inputs[i_input], &p_aout->pp_inputs[i_input + 1],
+             (AOUT_MAX_INPUTS - i_input - 1) * sizeof(aout_input_t *) );
+    p_aout->i_nb_inputs--;
+
+    vlc_mutex_unlock( &p_aout->mixer_lock );
+
+    aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters,
+                                 p_input->i_nb_filters );
+    aout_FifoDestroy( p_aout, &p_input->fifo );
+
+    free( p_input );
+
+    if ( !p_aout->i_nb_inputs )
+    {
+        aout_OutputDelete( p_aout );
+        aout_MixerDelete( p_aout );
+    }
+}
+
+/*****************************************************************************
+ * aout_InputPlay : play a buffer
+ *****************************************************************************/
+void aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
+                     aout_buffer_t * p_buffer )
+{
+    vlc_mutex_lock( &p_aout->input_lock );
+    while( p_aout->b_change_requested )
+    {
+        vlc_cond_wait( &p_aout->input_signal, &p_aout->input_lock );
+    }
+    p_aout->i_inputs_active++;
+    vlc_mutex_unlock( &p_aout->input_lock );
+
+    aout_FiltersPlay( p_aout, p_input->pp_filters, p_input->i_nb_filters,
+                      &p_buffer );
+
+    aout_FifoPush( p_aout, &p_input->fifo, p_buffer );
+
+    vlc_mutex_lock( &p_aout->input_lock );
+    p_aout->i_inputs_active--;
+    vlc_cond_broadcast( &p_aout->input_signal );
+    vlc_mutex_unlock( &p_aout->input_lock );
+}
diff --git a/src/audio_output/mixer.c b/src/audio_output/mixer.c
new file mode 100644 (file)
index 0000000..4a8d2b1
--- /dev/null
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * mixer.c : audio output mixing operations
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: mixer.c,v 1.1 2002/08/07 21:36:56 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h>                            /* calloc(), malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+
+#ifdef HAVE_ALLOCA_H
+#   include <alloca.h> 
+#endif
+
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * aout_MixerNew: prepare a mixer plug-in
+ *****************************************************************************/
+int aout_MixerNew( aout_instance_t * p_aout )
+{
+    p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL );
+    if ( p_aout->mixer.p_module == NULL )
+    {
+        msg_Err( p_aout, "no suitable aout mixer" );
+        return -1;
+    }
+    return 0;
+}
+
+/*****************************************************************************
+ * aout_MixerDelete: delete the mixer
+ *****************************************************************************/
+void aout_MixerDelete( aout_instance_t * p_aout )
+{
+    module_Unneed( p_aout, p_aout->mixer.p_module );
+}
+
+/*****************************************************************************
+ * aout_MixerRun: entry point for the mixer & post-filters processing
+ *****************************************************************************/
+void aout_MixerRun( aout_instance_t * p_aout )
+{
+    int             i;
+    aout_buffer_t * p_output_buffer;
+
+    /* See if we have enough data to prepare a new buffer for the audio
+     * output. */
+    mtime_t wanted_date = 0, first_date = 0;
+
+    for ( i = 0; i < p_aout->i_nb_inputs; i++ )
+    {
+        aout_fifo_t * p_fifo = &p_aout->pp_inputs[i]->fifo;
+        aout_buffer_t * p_buffer;
+        vlc_mutex_lock( &p_fifo->lock );
+        for ( p_buffer = p_fifo->p_first; p_buffer != NULL;
+              p_buffer = p_buffer->p_next )
+        {
+            if ( !wanted_date )
+            {
+                if ( !p_aout->output.last_date )
+                {
+                    first_date = p_buffer->start_date;
+                    wanted_date = p_buffer->start_date
+                        + (mtime_t)p_aout->output.i_nb_samples * 1000000
+                            / p_aout->output.output.i_rate;
+                }
+                else
+                {
+                    first_date = p_aout->output.last_date;
+                    wanted_date = p_aout->output.last_date
+                        + (mtime_t)p_aout->output.i_nb_samples * 1000000
+                           / p_aout->output.output.i_rate;
+                }
+            }
+
+            if ( p_buffer->end_date >= wanted_date ) break;
+        }
+        vlc_mutex_unlock( &p_fifo->lock );
+        if ( p_buffer == NULL ) break;
+    }
+
+    if ( i < p_aout->i_nb_inputs )
+    {
+        /* Interrupted before the end... We can't run. */
+        return;
+    }
+
+    /* Run the mixer. */
+    aout_BufferAlloc( &p_aout->mixer.output_alloc,
+                      (u64)(p_aout->output.i_nb_samples * 1000000)
+                        / p_aout->output.output.i_rate, NULL,
+                      p_output_buffer );
+    if ( p_output_buffer == NULL )
+    {
+        msg_Err( p_aout, "out of memory" );
+        return;
+    }
+    p_output_buffer->i_nb_samples = p_aout->output.i_nb_samples;
+    p_output_buffer->start_date = first_date;
+    p_output_buffer->end_date = wanted_date;
+    p_aout->output.last_date = wanted_date;
+
+    p_aout->mixer.pf_do_work( p_aout, p_output_buffer );
+
+    aout_OutputPlay( p_aout, p_output_buffer );
+}
+
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
new file mode 100644 (file)
index 0000000..f456fcd
--- /dev/null
@@ -0,0 +1,195 @@
+/*****************************************************************************
+ * output.c : internal management of output streams for the audio output
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: output.c,v 1.1 2002/08/07 21:36:56 massiot Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h>                            /* calloc(), malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * aout_OutputNew : allocate a new output and rework the filter pipeline
+ *****************************************************************************/
+int aout_OutputNew( aout_instance_t * p_aout,
+                    audio_sample_format_t * p_format )
+{
+    char * psz_name = config_GetPsz( p_aout, "aout" );
+    int i_rate = config_GetInt( p_aout, "aout-rate" );
+    int i_channels = config_GetInt( p_aout, "aout-channels" );
+
+    /* Prepare FIFO. */
+    vlc_mutex_init( p_aout, &p_aout->output.fifo.lock );
+    p_aout->output.fifo.p_first = NULL;
+    p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
+    p_aout->output.last_date = 0;
+
+    p_aout->output.p_module = module_Need( p_aout, "audio output",
+                                           psz_name );
+    if ( psz_name != NULL ) free( psz_name );
+    if ( p_aout->output.p_module == NULL )
+    {
+        msg_Err( p_aout, "no suitable aout module" );
+        return -1;
+    }
+
+    /* Retrieve user defaults. */
+    memcpy( &p_aout->output.output, p_format, sizeof(audio_sample_format_t) );
+    if ( i_rate != -1 ) p_aout->output.output.i_rate = i_rate;
+    if ( i_channels != -1 ) p_aout->output.output.i_channels = i_channels;
+    if ( p_aout->output.output.i_format != AOUT_FMT_A52 )
+    {
+        /* Non-S/PDIF mixer only deals with float32 or fixed32. */
+        p_aout->output.output.i_format
+                     = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ?
+                        AOUT_FMT_FLOAT32 : AOUT_FMT_FIXED32;
+    }
+
+    /* Find the best output format. */
+    if ( p_aout->output.pf_setformat( p_aout ) != 0 )
+    {
+        msg_Err( p_aout, "couldn't set an output format" );
+        module_Unneed( p_aout, p_aout->output.p_module );
+        return -1;
+    }
+
+    msg_Dbg( p_aout, "output format=%d rate=%d channels=%d",
+             p_aout->output.output.i_format, p_aout->output.output.i_rate,
+             p_aout->output.output.i_channels );
+
+    /* Calculate the resulting mixer output format. */
+    p_aout->mixer.output.i_channels = p_aout->output.output.i_channels;
+    p_aout->mixer.output.i_rate = p_aout->output.output.i_rate;
+    if ( p_aout->output.output.i_format != AOUT_FMT_A52 )
+    {
+        p_aout->mixer.output.i_format
+                     = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ?
+                        AOUT_FMT_FLOAT32 : AOUT_FMT_FIXED32;
+    }
+
+    /* Calculate the resulting mixer input format. */
+    p_aout->mixer.input.i_channels = -1; /* unchanged */
+    p_aout->mixer.input.i_rate = p_aout->mixer.output.i_rate;
+    p_aout->mixer.input.i_format = p_aout->mixer.output.i_format;
+
+    /* Create filters. */
+    if ( aout_FiltersCreatePipeline( p_aout, p_aout->output.pp_filters,
+                                     &p_aout->output.i_nb_filters,
+                                     &p_aout->mixer.output,
+                                     &p_aout->output.output ) < 0 )
+    {
+        msg_Err( p_aout, "couldn't set an output pipeline" );
+        module_Unneed( p_aout, p_aout->output.p_module );
+        return -1;
+    }
+
+    /* Prepare hints for the buffer allocator. */
+    p_aout->mixer.output_alloc.i_alloc_type = AOUT_ALLOC_HEAP;
+    p_aout->mixer.output_alloc.i_bytes_per_sec
+         = aout_FormatToBytes( &p_aout->output.output )
+            * p_aout->output.output.i_rate;
+
+    aout_FiltersHintBuffers( p_aout, p_aout->output.pp_filters,
+                             p_aout->output.i_nb_filters,
+                             &p_aout->mixer.output_alloc );
+
+    return 0;
+}
+
+/*****************************************************************************
+ * aout_OutputDelete : delete the output
+ *****************************************************************************/
+void aout_OutputDelete( aout_instance_t * p_aout )
+{
+    module_Unneed( p_aout, p_aout->output.p_module );
+
+    aout_FiltersDestroyPipeline( p_aout, p_aout->output.pp_filters,
+                                 p_aout->output.i_nb_filters );
+    aout_FifoDestroy( p_aout, &p_aout->output.fifo );
+}
+
+/*****************************************************************************
+ * aout_OutputPlay : play a buffer
+ *****************************************************************************/
+void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
+{
+    aout_FiltersPlay( p_aout, p_aout->output.pp_filters,
+                      p_aout->output.i_nb_filters,
+                      &p_buffer );
+
+    p_aout->output.pf_play( p_aout, p_buffer );
+}
+
+/*****************************************************************************
+ * aout_OutputNextBuffer : give the audio output plug-in the right buffer
+ *****************************************************************************/
+aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
+                                       mtime_t start_date )
+{
+    aout_buffer_t * p_buffer;
+
+    vlc_mutex_lock( &p_aout->output.fifo.lock );
+    p_buffer = p_aout->output.fifo.p_first;
+
+    while ( p_buffer != NULL && p_buffer->end_date < start_date )
+    {
+        msg_Dbg( p_aout, "audio output is too slow (%lld)",
+                 start_date - p_buffer->end_date );
+        p_buffer = p_buffer->p_next;
+    }
+
+    p_aout->output.fifo.p_first = p_buffer;
+    if ( p_buffer == NULL )
+    {
+        p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
+        vlc_mutex_unlock( &p_aout->output.fifo.lock );
+        msg_Dbg( p_aout, "audio output is starving" );
+        return NULL;
+    }
+
+    if ( p_buffer->start_date > start_date
+                                 + (mtime_t)p_aout->output.i_nb_samples
+                                 * 1000000 / p_aout->output.output.i_rate )
+    {
+        vlc_mutex_unlock( &p_aout->output.fifo.lock );
+        msg_Dbg( p_aout, "audio output is starving (%lld)",
+                 p_buffer->start_date - start_date );
+        return NULL;
+    }
+
+    /* FIXME : there we should handle the case where start_date is not
+     * completely equal to p_buffer->start_date. */
+
+    p_aout->output.fifo.p_first = p_buffer->p_next;
+    if ( p_buffer->p_next == NULL )
+    {
+        p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
+    }
+
+    vlc_mutex_unlock( &p_aout->output.fifo.lock );
+    return p_buffer;
+}
index 24cac14eaaad531434e7913d9672bbc73b97a794..5c89a12d8a6a484a64a34536f1f396706ac3f90a 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.c: main libvlc source
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.20 2002/08/04 20:04:11 sam Exp $
+ * $Id: libvlc.c,v 1.21 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -608,7 +608,7 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     intf_thread_t *p_intf;
     playlist_t    *p_playlist;
     vout_thread_t *p_vout;
-    aout_thread_t *p_aout;
+    aout_instance_t *p_aout;
 
     /* Check that the handle is valid */
     if( !p_vlc || p_vlc->i_status != VLC_STATUS_RUNNING )
@@ -658,9 +658,9 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     msg_Dbg( p_vlc, "removing all audio outputs" );
     while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
     {
-        vlc_object_detach_all( p_aout );
-        vlc_object_release( p_aout );
-        aout_DestroyThread( p_aout );
+        vlc_object_detach_all( (vlc_object_t *)p_aout );
+        vlc_object_release( (vlc_object_t *)p_aout );
+        aout_DeleteInstance( p_aout );
     }
 
     /* Update the handle status */
index bae56bc089ae9d46cf7b65ddffb7e82b4f5dbf19..ea8fdf5d2ca7fa70f343989e0fed14e46db7d97b 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.10 2002/08/04 17:23:44 sam Exp $
+ * $Id: libvlc.h,v 1.11 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
     "7 -> MPEG2 audio (unsupported)\n"              \
     "8 -> A52 pass-through")
 
-#define RATE_TEXT N_("audio output frequency (Hz)")
-#define RATE_LONGTEXT N_( \
+#define AOUT_RATE_TEXT N_("audio output frequency (Hz)")
+#define AOUT_RATE_LONGTEXT N_( \
     "You can force the audio output frequency here. Common values are " \
     "48000, 44100, 32000, 22050, 16000, 11025, 8000.")
 
+#define AOUT_CHANNELS_TEXT N_("number of channels of audio output")
+#define AOUT_CHANNELS_LONGTEXT N_( \
+    "Mono is 1, stereo is 2. Higher value (used for 5.1) may not be " \
+    "supported by your audio output module.")
+
 #define DESYNC_TEXT N_("compensate desynchronization of audio (in ms)")
 #define DESYNC_LONGTEXT N_( \
     "This option allows you to delay the audio output. This can be handy if " \
@@ -346,9 +351,10 @@ vlc_module_begin();
     add_module_with_short( "aout", 'A', "audio output", NULL, NULL,
                            AOUT_TEXT, AOUT_LONGTEXT );
     add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT );
-    add_bool( "mono", 0, NULL, MONO_TEXT, MONO_LONGTEXT );
     add_integer( "volume", VOLUME_DEFAULT, NULL, VOLUME_TEXT, VOLUME_LONGTEXT );
-    add_integer( "rate", 44100, NULL, RATE_TEXT, RATE_LONGTEXT );
+    add_integer( "aout-rate", -1, NULL, AOUT_RATE_TEXT, AOUT_RATE_LONGTEXT );
+    add_integer( "aout-channels", -1, NULL,
+                 AOUT_CHANNELS_TEXT, AOUT_CHANNELS_LONGTEXT );
     add_integer( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT );
     add_integer( "audio-format", 0, NULL, FORMAT_TEXT, FORMAT_LONGTEXT );
 
index b518f1f16790e36d52984b188c0125d9f8fbb976..4bd86bccd786ff43cdc1f8adf3f45c665b031384 100644 (file)
@@ -180,8 +180,14 @@ static inline const char * module_error( char *psz_buffer )
  * STORE_SYMBOLS: store known symbols into p_symbols for plugin access.
  *****************************************************************************/
 #define STORE_SYMBOLS( p_symbols ) \
-    (p_symbols)->__aout_CreateFifo_inner = __aout_CreateFifo; \
-    (p_symbols)->aout_DestroyFifo_inner = aout_DestroyFifo; \
+    (p_symbols)->__aout_NewInstance_inner = __aout_NewInstance; \
+    (p_symbols)->aout_DeleteInstance_inner = aout_DeleteInstance; \
+    (p_symbols)->aout_BufferNew_inner = aout_BufferNew; \
+    (p_symbols)->aout_BufferDelete_inner = aout_BufferDelete; \
+    (p_symbols)->aout_BufferPlay_inner = aout_BufferPlay; \
+    (p_symbols)->__aout_InputNew_inner = __aout_InputNew; \
+    (p_symbols)->aout_InputDelete_inner = aout_InputDelete; \
+    (p_symbols)->aout_OutputNextBuffer_inner = aout_OutputNextBuffer; \
     (p_symbols)->__config_GetInt_inner = __config_GetInt; \
     (p_symbols)->__config_PutInt_inner = __config_PutInt; \
     (p_symbols)->__config_GetFloat_inner = __config_GetFloat; \
index f1050f0cb7e7b261cebb6951f5ea0065f7dce702..276293fed32f5aa69f8cfbdf20844ba5d1a9a8ff 100644 (file)
@@ -2,7 +2,7 @@
  * objects.c: vlc_object_t handling
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.13 2002/08/04 18:39:41 sam Exp $
+ * $Id: objects.c,v 1.14 2002/08/07 21:36:56 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -38,6 +38,7 @@
 #include "video_output.h"
 
 #include "audio_output.h"
+#include "aout_internal.h"
 
 #include "vlc_playlist.h"
 #include "interface.h"
@@ -93,7 +94,7 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
             psz_type = "video output";
             break;
         case VLC_OBJECT_AOUT:
-            i_size = sizeof(aout_thread_t);
+            i_size = sizeof(aout_instance_t);
             psz_type = "audio output";
             break;
         default: