]> git.sesse.net Git - vlc/commitdiff
* Mandatory step for video output IV and the audio output quality
authorSam Hocevar <sam@videolan.org>
Tue, 1 May 2001 04:18:18 +0000 (04:18 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 1 May 2001 04:18:18 +0000 (04:18 +0000)
    fix: the output threads are now spawned when a decoder needs one,
    so it can decide the audio frequency or the video window size. Still
    under heavy construction, so don't get too excited at finding bugs
    in it yet.

    Note: this change broke the XVideo module, so I made its score much
    lower than before. I suspect xvideo.so had a bug before which only
    appears now. Other video output plugins may be broken as well, but
    again this might be due to old existing bugs showing their ugly head.

  * Fixed a few buffer overflows in the Gnome interface.
  * The module bank is now a global variable. The video output bank and
    the audio output bank might follow (when they exist).
  * Coding style and organization fixes to the spdif decoder.
  * autoconf and Makefile changes by Arnaud Gomes-do-Vale
    <arnaud@carrosse.frmug.org>.

72 files changed:
AUTHORS
ChangeLog
INSTALL
Makefile
Makefile.opts.in
configure
configure.in
doc/vlc.1
include/audio_output.h
include/config.h.in
include/defs.h.in
include/input_ext-dec.h
include/input_ext-intf.h
include/main.h
include/modules.h
include/modules_builtin.h.in
include/video_output.h
plugins/alsa/Makefile
plugins/beos/Makefile
plugins/beos/intf_beos.cpp
plugins/darwin/Makefile
plugins/dsp/Makefile
plugins/dummy/Makefile
plugins/dvd/Makefile
plugins/esd/Makefile
plugins/fb/Makefile
plugins/ggi/Makefile
plugins/glide/Makefile
plugins/gnome/Makefile
plugins/gnome/gnome_callbacks.c
plugins/gnome/intf_gnome.c
plugins/gtk/Makefile
plugins/idct/Makefile
plugins/macosx/Makefile
plugins/macosx/intf_macosx.c
plugins/mga/Makefile
plugins/motion/Makefile
plugins/mpeg/Makefile
plugins/null/Makefile
plugins/qt/Makefile
plugins/sdl/Makefile
plugins/text/Makefile
plugins/text/intf_rc.c
plugins/text/rc.c
plugins/x11/Makefile
plugins/x11/vout_xvideo.c
plugins/yuv/Makefile
src/ac3_decoder/ac3_decoder_thread.c
src/ac3_decoder/ac3_decoder_thread.h
src/ac3_spdif/ac3_iec958.c
src/ac3_spdif/ac3_iec958.h
src/ac3_spdif/ac3_spdif.c
src/ac3_spdif/ac3_spdif.h
src/audio_decoder/audio_decoder.c
src/audio_decoder/audio_decoder.h
src/audio_output/aout_common.h
src/audio_output/aout_ext-dec.c [moved from src/audio_output/aout_fifo.c with 59% similarity]
src/audio_output/aout_s16.c
src/audio_output/aout_u8.c
src/audio_output/audio_output.c
src/input/input.c
src/input/input_programs.c
src/interface/interface.c
src/interface/main.c
src/lpcm_decoder/lpcm_decoder_thread.c
src/lpcm_decoder/lpcm_decoder_thread.h
src/misc/modules.c
src/video_output/video_output.c
src/video_output/video_yuv.c
src/video_parser/video_parser.c
src/video_parser/vpar_headers.c
vlc.spec

diff --git a/AUTHORS b/AUTHORS
index f60ecb3c59aaa8f0e819cf9ce18b4606a74c7f3f..61232f669bc0eeadd3299af4f8341228ddfe2f63 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -46,7 +46,7 @@ D: AC3 decoder
 
 N: Nilmoni Deb
 E: ndeb@ece.cmu.edu
-D: Minor configure.in and Makefile.in fixes
+D: Minor autoconf and Makefile fixes
 
 N: Cyril Deguet
 C: asmax
@@ -75,6 +75,10 @@ D: ALSA audio output
 D: input netlist
 D: MPEG TS input
 
+N: Arnaud Gomes-do-Vale
+E: arnaud@carrosse.frmug.org
+D: autoconf patches
+
 N: Jean-Philippe Grimaldi
 E: jeanphi@via.ecp.fr
 C: jeanphi
@@ -148,7 +152,7 @@ D: MPEG video decoder
 
 N: Arkadiusz Miskiewicz
 E: misiek@pld.ORG.PL
-D: Makefile and configure patches
+D: autoconf and Makefile patches
 
 N: Olivier Pomel
 E: pomel@via.ecp.fr
@@ -169,7 +173,7 @@ D: BeOS video output (BBitmap and Overlay)
 
 N: Espen Skoglund
 E: esk@ira.uka.de
-D: FreeBSD configure.in and Makefile patches
+D: FreeBSD autoconf and Makefile patches
 
 N: Benoit Steiner
 E: benny@via.ecp.fr
index b90e177642b96b92502102455317e6e1428d6e7b..a0ae62eada7a0bebb0cac6e1f7cfa45db1195206 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,7 +4,16 @@
 
 HEAD
 
-  * DVD title change no longer restart the input.
+  * Mandatory step for video output IV and the audio output quality
+    fix: the output threads are now spawned when a decoder needs one,
+    so it can decide the audio frequency or the video window size.
+  * Fixed a few buffer overflows in the Gnome interface.
+  * The module bank is now a global variable. The video output bank and
+    the audio output bank might follow (when they exist).
+  * Coding style and organization fixes to the spdif decoder.
+  * autoconf and Makefile changes by Arnaud Gomes-do-Vale
+    <arnaud@carrosse.frmug.org>.
+  * DVD title change no longer restarts the input.
   * BeOS crash fix by Wade Majors <guru@startrek.com>.
   * Slight modification in ClockManageRef: after a synchro reinit, we still
     do the mwait and re-init last-cr.
diff --git a/INSTALL b/INSTALL
index ce399befc03dac93eaec7cc30cca4877d9f4b331..7faafafbbd6019f7d4fcc8d1dc5d0ace8fb4f5d8 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -14,13 +14,13 @@ Here is a shortcut to copy-paste for a complete build:
 
    make distclean && ./configure --prefix=/usr --enable-gnome \
       --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
-      --enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo
+      --enable-mga --enable-gtk --enable-qt --enable-xvideo
 
 If you intend to debug stuff, you may want to disable optimizations:
 
    make distclean && ./configure --prefix=/usr --enable-gnome \
       --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
-      --enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo \
+      --enable-mga --enable-gtk --enable-qt --enable-xvideo \
       --disable-optimizatons
 
 
index 4f494d813f0723085c3fe8b7bf526e6d094c4665..e725cfd42b38edede2f95be3476618518dbbf57d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,17 +40,17 @@ INTERFACE = src/interface/main.o \
                src/interface/intf_channels.o \
                src/interface/intf_urldecode.o \
 
-INPUT =                src/input/input_ext-dec.o \
+INPUT =                src/input/input.o \
+               src/input/input_ext-dec.o \
                src/input/input_ext-intf.o \
                src/input/input_dec.o \
                src/input/input_programs.o \
                src/input/input_netlist.o \
                src/input/input_clock.o \
-               src/input/input.o \
                src/input/mpeg_system.o
 
 AUDIO_OUTPUT =         src/audio_output/audio_output.o \
-               src/audio_output/aout_fifo.o \
+               src/audio_output/aout_ext-dec.o \
                src/audio_output/aout_u8.o \
                src/audio_output/aout_s8.o \
                src/audio_output/aout_u16.o \
@@ -356,5 +356,4 @@ $(PLUGIN_OBJ): FORCE
 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
 $(BUILTIN_OBJ): FORCE
        cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
-       $(RANLIB) $@
 
index 98d9be81297ad8a891739701e3ccfb0149a1578f..eb4d17dadde8dbed344ca188a0b6fe0e5d8f872e 100644 (file)
@@ -45,6 +45,7 @@ CC = @CC@
 CFLAGS = @CFLAGS@
 SHELL = @SHELL@
 RANLIB = @RANLIB@
+MOC = @MOC@
 
 # 
 # Installation environment
index e07896ce5c37032e540b7358a7b056331c75d0c6..cfc4a763e744f4e4c18ff496d36cd1e918ec7dcc 100755 (executable)
--- a/configure
+++ b/configure
@@ -1847,14 +1847,69 @@ else
 fi
 done
 
+for ac_func in swab
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1854: 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 1859 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1882: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:1853: checking for getopt_long" >&5
+echo "configure:1908: 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 1858 "configure"
+#line 1913 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -1877,7 +1932,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1936: \"$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
@@ -1899,7 +1954,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:1903: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:1958: 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
@@ -1907,7 +1962,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnugetopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1911 "configure"
+#line 1966 "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
@@ -1918,7 +1973,7 @@ int main() {
 getopt_long()
 ; return 0; }
 EOF
-if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1977: \"$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
@@ -1950,17 +2005,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:1954: checking for $ac_hdr" >&5
+echo "configure:2009: 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 1959 "configure"
+#line 2014 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2019: \"$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*
@@ -1989,12 +2044,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1993: checking for $ac_func" >&5
+echo "configure:2048: 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 1998 "configure"
+#line 2053 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2017,7 +2072,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2076: \"$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
@@ -2042,7 +2097,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2046: checking for working mmap" >&5
+echo "configure:2101: 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
@@ -2050,7 +2105,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2054 "configure"
+#line 2109 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2190,7 +2245,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2249: \"$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
@@ -2213,12 +2268,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2217: checking return type of signal handlers" >&5
+echo "configure:2272: 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 2222 "configure"
+#line 2277 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2235,7 +2290,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2254,7 +2309,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2258: checking for dlopen in -ldl" >&5
+echo "configure:2313: 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
@@ -2262,7 +2317,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2266 "configure"
+#line 2321 "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
@@ -2273,7 +2328,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2332: \"$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
@@ -2294,7 +2349,7 @@ else
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:2298: checking for pow in -lm" >&5
+echo "configure:2353: 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
@@ -2302,7 +2357,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2306 "configure"
+#line 2361 "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
@@ -2313,7 +2368,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:2317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2372: \"$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
@@ -2334,9 +2389,9 @@ else
 fi
 
 echo $ac_n "checking for old style FreeBSD -pthread flag""... $ac_c" 1>&6
-echo "configure:2338: checking for old style FreeBSD -pthread flag" >&5
+echo "configure:2393: checking for old style FreeBSD -pthread flag" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2340 "configure"
+#line 2395 "configure"
 #include "confdefs.h"
 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001
          yes
@@ -2352,7 +2407,7 @@ else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
        echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2356: checking for pthread_create in -lpthread" >&5
+echo "configure:2411: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2360,7 +2415,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2364 "configure"
+#line 2419 "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
@@ -2371,7 +2426,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2430: \"$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
@@ -2395,7 +2450,7 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6
-echo "configure:2399: checking for thread_create in -lthreads" >&5
+echo "configure:2454: checking for thread_create in -lthreads" >&5
 ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2403,7 +2458,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2407 "configure"
+#line 2462 "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
@@ -2414,7 +2469,7 @@ int main() {
 thread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2473: \"$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
@@ -2441,17 +2496,17 @@ for ac_hdr in stddef.h getopt.h strings.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2445: checking for $ac_hdr" >&5
+echo "configure:2500: 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 2450 "configure"
+#line 2505 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2510: \"$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*
@@ -2481,17 +2536,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2485: checking for $ac_hdr" >&5
+echo "configure:2540: 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 2490 "configure"
+#line 2545 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2550: \"$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*
@@ -2521,17 +2576,17 @@ for ac_hdr in 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:2525: checking for $ac_hdr" >&5
+echo "configure:2580: 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 2530 "configure"
+#line 2585 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2590: \"$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*
@@ -2561,17 +2616,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:2565: checking for $ac_hdr" >&5
+echo "configure:2620: 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 2570 "configure"
+#line 2625 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2630: \"$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*
@@ -2601,17 +2656,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:2605: checking for $ac_hdr" >&5
+echo "configure:2660: 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 2610 "configure"
+#line 2665 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2670: \"$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*
@@ -2641,17 +2696,17 @@ for ac_hdr in machine/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2645: checking for $ac_hdr" >&5
+echo "configure:2700: 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 2650 "configure"
+#line 2705 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2710: \"$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*
@@ -2682,17 +2737,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:2686: checking for $ac_hdr" >&5
+echo "configure:2741: 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 2691 "configure"
+#line 2746 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2751: \"$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*
@@ -2720,7 +2775,7 @@ done
 
 
 cat > conftest.$ac_ext <<EOF
-#line 2724 "configure"
+#line 2779 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -2737,7 +2792,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2741 "configure"
+#line 2796 "configure"
 #include "confdefs.h"
 #include <strings.h>
 EOF
@@ -2756,9 +2811,9 @@ rm -f conftest*
 
 CFLAGS="${CFLAGS} -Wall -Werror"
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:2760: checking for ntohl in sys/param.h" >&5
+echo "configure:2815: checking for ntohl in sys/param.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2762 "configure"
+#line 2817 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 void foo() { int meuh; ntohl(meuh); }
@@ -2766,7 +2821,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define NTOHL_IN_SYS_PARAM_H 1
@@ -2783,16 +2838,16 @@ rm -f conftest*
 
 CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
 echo $ac_n "checking if \$CC groks -rdynamic without complaining too much""... $ac_c" 1>&6
-echo "configure:2787: checking if \$CC groks -rdynamic without complaining too much" >&5
+echo "configure:2842: checking if \$CC groks -rdynamic without complaining too much" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2789 "configure"
+#line 2844 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   LCFLAGS="${LCFLAGS} -rdynamic"
  echo "$ac_t""yes" 1>&6
@@ -2807,9 +2862,9 @@ rm -f conftest*
 CFLAGS="${save_CFLAGS}"
 
 echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2811: checking for boolean_t in sys/types.h" >&5
+echo "configure:2866: checking for boolean_t in sys/types.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2813 "configure"
+#line 2868 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 void quux() { boolean_t foo; }
@@ -2817,7 +2872,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define BOOLEAN_T_IN_SYS_TYPES_H 1
@@ -2832,9 +2887,9 @@ else
 fi
 rm -f conftest*
 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:2836: checking for boolean_t in pthread.h" >&5
+echo "configure:2891: checking for boolean_t in pthread.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2838 "configure"
+#line 2893 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 void quux() { boolean_t foo; }
@@ -2842,7 +2897,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define BOOLEAN_T_IN_PTHREAD_H 1
@@ -2858,12 +2913,12 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2862: checking for working const" >&5
+echo "configure:2917: 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 2867 "configure"
+#line 2922 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2912,7 +2967,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2933,12 +2988,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2937: checking for ANSI C header files" >&5
+echo "configure:2992: 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 2942 "configure"
+#line 2997 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2946,7 +3001,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3005: \"$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*
@@ -2963,7 +3018,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 2967 "configure"
+#line 3022 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2981,7 +3036,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 2985 "configure"
+#line 3040 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3002,7 +3057,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 3006 "configure"
+#line 3061 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3013,7 +3068,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -3037,12 +3092,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3041: checking for size_t" >&5
+echo "configure:3096: 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 3046 "configure"
+#line 3101 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3070,12 +3125,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3074: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3129: 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 3079 "configure"
+#line 3134 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3084,7 +3139,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3124,17 +3179,17 @@ for ac_hdr in sys/ioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3128: checking for $ac_hdr" >&5
+echo "configure:3183: 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 3133 "configure"
+#line 3188 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3193: \"$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*
@@ -3160,17 +3215,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3164: checking for $ac_hdr" >&5
+echo "configure:3219: 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 3169 "configure"
+#line 3224 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3229: \"$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*
@@ -3197,7 +3252,7 @@ fi
 done
 
   cat > conftest.$ac_ext <<EOF
-#line 3201 "configure"
+#line 3256 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -3348,7 +3403,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:3352: checking for $ac_word" >&5
+echo "configure:3407: 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
@@ -3413,17 +3468,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3417: checking for $ac_hdr" >&5
+echo "configure:3472: 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 3422 "configure"
+#line 3477 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3482: \"$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*
@@ -3494,17 +3549,17 @@ if test "${with_sdl+set}" = set; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3498: checking for $ac_hdr" >&5
+echo "configure:3553: 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 3503 "configure"
+#line 3558 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3563: \"$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*
@@ -3542,17 +3597,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3546: checking for $ac_hdr" >&5
+echo "configure:3601: 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 3551 "configure"
+#line 3606 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3611: \"$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*
@@ -3614,6 +3669,12 @@ if test "${enable_qt+set}" = set; then
      PLUGINS="${PLUGINS} qt"
      ALIASES="${ALIASES} qvlc"
      LIB_QT="-lqt -L${QTDIR}/lib"
+     if test -x ${QTDIR}/bin/moc ;
+     then
+       MOC=${QTDIR}/bin/moc
+     else
+       MOC=moc
+     fi
    fi
 fi
 
@@ -3646,7 +3707,7 @@ if test x$enable_gtk != xno; then
   # 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:3650: checking for $ac_word" >&5
+echo "configure:3711: 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
@@ -3706,17 +3767,17 @@ if test x$enable_x11 != xno; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3710: checking for $ac_hdr" >&5
+echo "configure:3771: 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 3715 "configure"
+#line 3776 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3781: \"$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*
@@ -3768,17 +3829,17 @@ if test x$enable_xvideo != xno; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3772: checking for $ac_hdr" >&5
+echo "configure:3833: 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 3777 "configure"
+#line 3838 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3843: \"$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*
@@ -3816,17 +3877,17 @@ if test "${enable_alsa+set}" = set; then
   enableval="$enable_alsa"
   if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:3820: checking for sys/asoundlib.h" >&5
+echo "configure:3881: checking for sys/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 3825 "configure"
+#line 3886 "configure"
 #include "confdefs.h"
 #include <sys/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3891: \"$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*
@@ -3843,7 +3904,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:3847: checking for main in -lasound" >&5
+echo "configure:3908: 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
@@ -3851,14 +3912,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3855 "configure"
+#line 3916 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3923: \"$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
@@ -3928,6 +3989,7 @@ fi
 
 
 
+
 
 
 trap '' 1 2 15
@@ -4092,6 +4154,7 @@ s%@STATS@%$STATS%g
 s%@TRACE@%$TRACE%g
 s%@OPTIMS@%$OPTIMS%g
 s%@CSS@%$CSS%g
+s%@MOC@%$MOC%g
 s%@LCFLAGS@%$LCFLAGS%g
 s%@LIB@%$LIB%g
 s%@LIB_ALSA@%$LIB_ALSA%g
@@ -4346,8 +4409,8 @@ trace mode            : ${TRACE}
 optimizations         : ${OPTIMS}
 CSS decryption        : ${CSS}
 need builtin getopt   : ${GETOPT}
-plugin modules        :${PLUGINS}
 built-in modules      :${BUILTINS}
+plugin modules        :${PLUGINS}
 vlc aliases           :${ALIASES}
 
 You may now tune Makefile.opts at your convenience."
index 2b456668dfac616cf06933aeebe3bdfc7c33b367..33fe2a50150e5368a51e3e6e06d1c746ae85ae35 100644 (file)
@@ -48,6 +48,7 @@ AC_CHECK_FUNC(inet_aton,,[
   AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
 ])
 AC_CHECK_FUNCS(vasprintf)
+AC_CHECK_FUNCS(swab)
 
 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
 [ # FreeBSD has a gnugetopt library for this:
@@ -392,6 +393,12 @@ AC_ARG_ENABLE(qt,
      PLUGINS="${PLUGINS} qt"
      ALIASES="${ALIASES} qvlc"
      LIB_QT="-lqt -L${QTDIR}/lib"
+     if test -x ${QTDIR}/bin/moc ;
+     then
+       MOC=${QTDIR}/bin/moc
+     else
+       MOC=moc
+     fi
    fi])
 
 dnl 
@@ -499,6 +506,7 @@ AC_SUBST(STATS)
 AC_SUBST(TRACE)
 AC_SUBST(OPTIMS)
 AC_SUBST(CSS)
+AC_SUBST(MOC)
 
 AC_SUBST(LCFLAGS)
 AC_SUBST(LIB)
@@ -539,8 +547,8 @@ trace mode            : ${TRACE}
 optimizations         : ${OPTIMS}
 CSS decryption        : ${CSS}
 need builtin getopt   : ${GETOPT}
-plugin modules        :${PLUGINS}
 built-in modules      :${BUILTINS}
+plugin modules        :${PLUGINS}
 vlc aliases           :${ALIASES}
 
 You may now tune Makefile.opts at your convenience."
index 19d16baa69ab9755fb0472bb4ce5add6a6c15164..494508125fd773bec807f913c1f41cf6e8cfee82 100644 (file)
--- a/doc/vlc.1
+++ b/doc/vlc.1
@@ -47,7 +47,10 @@ Disable audio output.
 Specify an audio output module: "dsp", "esd", for instance.
 .TP
 .B \-\-stereo, \-\-mono
-Choose stereo or mono audio output
+Choose stereo or mono audio output.
+.TP
+.B \-\-spdif
+Activate hardware AC3 pass-through mode.
 .TP
 .B \-\-novideo
 Disable video output.
@@ -145,6 +148,7 @@ also accepts a lot of parameters to customize its behaviour.
  vlc_aout=<method name>   audio method
  vlc_dsp=<filename>       dsp device path
  vlc_stereo={1|0}         stereo or mono output
+ vlc_spdif={1|0}          AC3 pass-through mode
  vlc_audio_rate=<rate>    output rate
 .TP
 .B Video parameters:
index 0576f2415a95fe490b34e918c6e72c88f976c7ae..b7301c1007d9317dababdcb0ca183330d96b61cf 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.h : audio output thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.32 2001/04/29 02:48:51 stef Exp $
+ * $Id: audio_output.h,v 1.33 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-/*****************************************************************************
- * Required headers:
- * - "common.h"                                                   ( boolean_t )
- * - "mtime.h"                                                      ( mtime_t )
- * - "threads.h"                                               ( vlc_thread_t )
- *****************************************************************************/
-
-/* TODO :
- *
- * - Créer un flag destroy dans les fifos audio pour indiquer au thread audio
- *   qu'il peut libérer la mémoire occupée par le buffer de la fifo lorsqu'il
- *   le désire (fin du son ou fin du thread)
- *
- */
-
-/*
- * Macros
- */
-#define AOUT_FIFO_ISEMPTY( fifo )       ( (fifo).l_end_frame == (fifo).l_start_frame )
-#define AOUT_FIFO_ISFULL( fifo )        ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
-
 /*****************************************************************************
  * aout_increment_t
  *****************************************************************************
@@ -112,23 +91,22 @@ typedef struct aout_fifo_s
 
 } aout_fifo_t;
 
+#define AOUT_FIFO_ISEMPTY( fifo ) \
+  ( (fifo).l_end_frame == (fifo).l_start_frame )
+
+#define AOUT_FIFO_ISFULL( fifo ) \
+  ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
+
 #define AOUT_EMPTY_FIFO         0
 #define AOUT_INTF_MONO_FIFO     1
 #define AOUT_INTF_STEREO_FIFO   2
 #define AOUT_ADEC_MONO_FIFO     3
 #define AOUT_ADEC_STEREO_FIFO   4
+#define AOUT_ADEC_SPDIF_FIFO    5
 
 /*****************************************************************************
  * aout_thread_t : audio output thread descriptor
  *****************************************************************************/
-typedef int  (aout_open_t)       ( p_aout_thread_t p_aout );
-typedef int  (aout_setformat_t)  ( p_aout_thread_t p_aout );
-typedef long (aout_getbufinfo_t) ( p_aout_thread_t p_aout,
-                                   long l_buffer_limit );
-typedef void (aout_play_t)       ( p_aout_thread_t p_aout,
-                                   byte_t *buffer, int i_size );
-typedef void (aout_close_t)      ( p_aout_thread_t p_aout );
-
 typedef struct aout_thread_s
 {
     vlc_thread_t        thread_id;
@@ -140,11 +118,11 @@ typedef struct aout_thread_s
 
     /* Plugin used and shortcuts to access its capabilities */
     struct module_s *   p_module;
-    aout_open_t *       pf_open;
-    aout_setformat_t *  pf_setformat;
-    aout_getbufinfo_t * pf_getbufinfo;
-    aout_play_t *       pf_play;
-    aout_close_t *      pf_close;
+    int              ( *pf_open )       ( p_aout_thread_t );
+    int              ( *pf_setformat )  ( p_aout_thread_t );
+    long             ( *pf_getbufinfo ) ( p_aout_thread_t, long );
+    void             ( *pf_play )       ( p_aout_thread_t, byte_t *, int );
+    void             ( *pf_close )      ( p_aout_thread_t );
 
     void *              buffer;
     /* The s32 buffer is used to mix all the audio fifos together before
@@ -164,6 +142,8 @@ typedef struct aout_thread_s
     char *              psz_device;
     int                 i_fd;
 
+    /* The current volume */
+    int                 i_vol;
     /* Format of the audio output samples */
     int                 i_format;
     /* Number of channels */
@@ -178,10 +158,6 @@ typedef struct aout_thread_s
      * for the OSS output */
     p_aout_sys_t        p_sys;
 
-
-    /* there is the current volume */
-    int                 vol;
-
 } aout_thread_t;
 
 /* Those are from <linux/soundcard.h> but are needed because of formats
@@ -205,11 +181,9 @@ typedef struct aout_thread_s
  * Prototypes
  *****************************************************************************/
 aout_thread_t * aout_CreateThread       ( int *pi_status );
-void            aout_DestroyThread      ( aout_thread_t *p_aout,
-                                          int *pi_status );
+void            aout_DestroyThread      ( aout_thread_t *, int * );
 
-aout_fifo_t *   aout_CreateFifo         ( aout_thread_t *p_aout,
-                                          aout_fifo_t *p_fifo );
+aout_fifo_t *   aout_CreateFifo         ( int, int, long, long, long, void * );
 void            aout_DestroyFifo        ( aout_fifo_t *p_fifo );
 void            aout_FreeFifo           ( aout_fifo_t *p_fifo );
 
index 4025bd6ea0f0cd8bf0bed18138495a1c5caa9435..f61f7bd6486554c29d68a58c652c210f41c399a6 100644 (file)
 #define AOUT_STEREO_VAR                 "vlc_stereo"
 #define AOUT_STEREO_DEFAULT             1
 
+/* Environment variable for spdif mode */
+#define AOUT_SPDIF_VAR                  "vlc_spdif"
+#define AOUT_SPDIF_DEFAULT              0
+
 /* Volume */
 #define VOLUME_DEFAULT                  512
 #define VOLUME_STEP                     128
index 9caa9fed28c5ae54f3a26f41b5131c41d7d2df05..32fbf9cf7c7d250b0a09aa47d36d20938da412ff 100644 (file)
@@ -46,6 +46,9 @@
 /* Define if you have the strtol function.  */
 #undef HAVE_STRTOL
 
+/* Define if you have the swab function.  */
+#undef HAVE_SWAB
+
 /* Define if you have the usleep function.  */
 #undef HAVE_USLEEP
 
index d79a7422636de9801a29247427e2b48c8db18f85..688669190b93ef3fa53627742ad33118ff04df41 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-dec.h: structures exported to the VideoLAN decoders
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-dec.h,v 1.30 2001/04/28 03:36:25 sam Exp $
+ * $Id: input_ext-dec.h,v 1.31 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Kaempf <maxx@via.ecp.fr>
@@ -545,15 +545,10 @@ typedef struct vdec_config_s
  *****************************************************************************
  * Pointers given to audio decoders threads.
  *****************************************************************************/
-struct aout_thread_s;
-
 typedef struct adec_config_s
 {
-    struct aout_thread_s *  p_aout;
-
-    struct aout_fifo_s * (* pf_create_fifo)( struct aout_thread_s *,
-                                            struct aout_fifo_s * );
-    void                 (* pf_destroy_fifo)( struct aout_thread_s *);
+    struct aout_fifo_s * (* pf_create_fifo)( struct aout_fifo_s * );
+    void                 (* pf_destroy_fifo)( void );
 
     decoder_config_t        decoder_config;
 } adec_config_t;
index 55014885c0819ee2b8b2a0779e9aa7c5cef91efc..d426c265ead8a22b12b8fc64f0340a935f125496 100644 (file)
@@ -4,7 +4,7 @@
  * control the pace of reading. 
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.34 2001/04/20 05:40:03 stef Exp $
+ * $Id: input_ext-intf.h,v 1.35 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -134,7 +134,6 @@ typedef struct pgrm_descriptor_s
 
     /* Decoders control */
     struct vout_thread_s *  p_vout;
-    struct aout_thread_s *  p_aout;
 
     int                     i_es_number;      /* size of the following array */
     es_descriptor_t **      pp_es;                /* array of pointers to ES */
@@ -250,7 +249,6 @@ typedef struct i_p_config_s
  *****************************************************************************
  * This structure includes all the local static variables of an input thread
  *****************************************************************************/
-struct aout_thread_s;
 struct vout_thread_s;
 
 typedef struct input_thread_s
@@ -305,7 +303,6 @@ typedef struct input_thread_s
     stream_descriptor_t     stream;                            /* PAT tables */
 
     /* For auto-launch of decoders */
-    struct aout_thread_s *  p_default_aout;
     struct vout_thread_s *  p_default_vout;
 
 #ifdef STATS
index d5965d0937e4d4d4bcb0b78ab840d84567865577..bd868c2b985542a58f991cd61e3c87462d53e2c7 100644 (file)
@@ -3,7 +3,7 @@
  * Declaration and extern access to global program object.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: main.h,v 1.16 2001/04/29 02:48:51 stef Exp $
+ * $Id: main.h,v 1.17 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -48,7 +48,6 @@ typedef struct
     boolean_t              b_audio;             /* is audio output allowed ? */
     boolean_t              b_video;             /* is video output allowed ? */
     boolean_t              b_channels;    /* is channel changing supported ? */
-    boolean_t              b_spdif;                          /* spdif mode ? */
 
     /* Unique threads */
     p_vout_thread_t        p_vout;                    /* video output thread */
@@ -57,7 +56,6 @@ typedef struct
 
     /* Shared data - these structures are accessed directly from p_main by
      * several modules */
-    struct module_bank_s * p_bank;                            /* module bank */
     p_playlist_t           p_playlist;                           /* playlist */
     p_intf_msg_t           p_msg;                 /* messages interface data */
     p_input_channel_t      p_channel;                /* channel library data */
index 728cc32d4cdfb2222eaa46799aef56e00434064d..3752aad30deadb4afeaf2aed8d487f9e0a15a0cc 100644 (file)
@@ -2,7 +2,7 @@
  * modules.h : Module management functions.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.21 2001/04/28 03:36:25 sam Exp $
+ * $Id: modules.h,v 1.22 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
 #include <sys/types.h>                                              /* off_t */
 #endif
 
+/*****************************************************************************
+ * bank_t, p_bank (global variable)
+ *****************************************************************************
+ * This global variable is accessed by any function using modules.
+ *****************************************************************************/
+typedef struct
+{
+    struct module_s *   first; /* First module of the bank */
+
+    vlc_mutex_t         lock;  /* Global lock -- you can't imagine how awful it
+                                  is to design thread-safe linked lists. */
+} bank_t;
+
+extern bank_t *p_bank;
+
+/*****************************************************************************
+ * Module #defines.
+ *****************************************************************************/
+
 /* Number of tries before we unload an unused module */
 #define MODULE_HIDE_DELAY 100
 
@@ -224,15 +243,6 @@ typedef struct module_config_s
  * Bank and module description structures
  *****************************************************************************/
 
-/* The module bank structure */
-typedef struct module_bank_s
-{
-    struct module_s *   first; /* First module of the bank */
-
-    vlc_mutex_t         lock;  /* Global lock -- you can't imagine how awful it
-                                  is to design thread-safe linked lists. */
-} module_bank_t;
-
 /* The module description structure */
 typedef struct module_s
 {
@@ -275,14 +285,10 @@ typedef struct module_s
 /*****************************************************************************
  * Exported functions.
  *****************************************************************************/
-module_bank_t * module_CreateBank   ( void );
-void            module_InitBank     ( module_bank_t * p_bank );
-void            module_DestroyBank  ( module_bank_t * p_bank );
-void            module_ResetBank    ( module_bank_t * p_bank );
-void            module_ManageBank   ( module_bank_t * p_bank );
-
-module_t *      module_Need         ( module_bank_t *p_bank,
-                                      int i_capabilities, void *p_data );
-void            module_Unneed       ( module_bank_t * p_bank,
-                                      module_t * p_module );
+void            module_InitBank     ( void );
+void            module_EndBank      ( void );
+void            module_ResetBank    ( void );
+void            module_ManageBank   ( void );
+module_t *      module_Need         ( int i_capabilities, void *p_data );
+void            module_Unneed       ( module_t * p_module );
 
index ac1cbdcaee618a33b27eb72986150114e1930f9d..ccbfa125f40129a9696764b9308b458c36f30bdd 100644 (file)
@@ -21,9 +21,9 @@
  *****************************************************************************/
 
 #define ALLOCATE_BUILTIN( NAME ) \
-    AllocateBuiltinModule( p_bank, module_ ## NAME ## _InitModule, \
-                                   module_ ## NAME ## _ActivateModule, \
-                                   module_ ## NAME ## _DeactivateModule );
+    AllocateBuiltinModule( module_ ## NAME ## _InitModule, \
+                           module_ ## NAME ## _ActivateModule, \
+                           module_ ## NAME ## _DeactivateModule );
 
 /* Add stuff here */
 
index c654fdbe74408652e0729c5752989ef40937a356..3923a275ee8dc834216daa1753ee66fb902f21ee 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppenned video output thread.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.57 2001/03/21 13:42:33 sam Exp $
+ * $Id: video_output.h,v 1.58 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -106,6 +106,28 @@ typedef struct vout_buffer_s
     byte_t *    p_data;                                    /* memory address */
 } vout_buffer_t;
 
+/*****************************************************************************
+ * vout_fifo_t
+ *****************************************************************************/
+typedef struct vout_fifo_s
+{
+    /* See the fifo types below */
+    int                 i_type;
+    boolean_t           b_die;
+    int                 i_fifo;      /* Just to keep track of the fifo index */
+
+    int                 i_width;
+    int                 i_height;
+
+    vlc_mutex_t         data_lock;
+    vlc_cond_t          data_wait;
+
+} vout_fifo_t;
+
+#define VOUT_EMPTY_FIFO         0
+#define VOUT_YUV_FIFO           1
+#define VOUT_SPU_FIFO           2
+
 /*****************************************************************************
  * vout_thread_t: video output thread descriptor
  *****************************************************************************
@@ -236,6 +258,11 @@ typedef struct vout_thread_s
  *****************************************************************************/
 vout_thread_t * vout_CreateThread   ( int *pi_status );
 void            vout_DestroyThread  ( vout_thread_t *p_vout, int *pi_status );
+
+vout_fifo_t *   vout_CreateFifo         ( void );
+void            vout_DestroyFifo        ( vout_fifo_t *p_fifo );
+void            vout_FreeFifo           ( vout_fifo_t *p_fifo );
+
 picture_t *     vout_CreatePicture  ( vout_thread_t *p_vout, int i_type,
                                       int i_width, int i_height );
 void            vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic );
index b2336abe23f0a5b34cf4f25d9ebf6ad232f2fdee..34bf64c22f292b996ab139a06a43578390af1cab 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/alsa.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index e185457bf5f496f6a23370793a3d77135b46b5ab..654c8d5cca4ff9da003bbdab20efc30da8ec5af1 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/beos.a: $(BUILTIN_CPP)
        ar r $@ $^
+       $(RANLIB) $@
 
index bee872e340d782f9638c185a03f5f73f75d30fc8..554fb903a9cdbf7a2c50e88028bfe4db6a9f20f0 100644 (file)
@@ -2,7 +2,7 @@
  * intf_beos.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: intf_beos.cpp,v 1.26 2001/04/29 17:03:20 sam Exp $
+ * $Id: intf_beos.cpp,v 1.27 2001/05/01 04:18:17 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -281,7 +281,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                        // silence the sound, otherwise very horrible
                        if (p_main->p_aout != NULL)
                        {
-                               p_main->p_aout->vol = 0;
+                               p_main->p_aout->i_vol = 0;
                        }
                        snooze(400000);
                        input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
@@ -293,7 +293,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 //             {                       
 //                     if (p_main->p_aout != NULL)
 //                     {
-//                             p_main->p_aout->vol = vol_val;
+//                             p_main->p_aout->i_vol = vol_val;
 //                     }
 //                     snooze(400000);
 //                     input_SetStatus(p_intf->p_input, INPUT_STATUS_PLAY);
@@ -309,7 +309,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                        {
                                if (p_main->p_aout != NULL)
                                {
-                                       p_main->p_aout->vol = 0;
+                                       p_main->p_aout->i_vol = 0;
                                }
                                playback_status = PAUSED;
                        }
@@ -318,7 +318,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                        {
                                if (p_main->p_aout != NULL)
                                {
-                                       p_main->p_aout->vol = vol_val;
+                                       p_main->p_aout->i_vol = vol_val;
                                }
                                playback_status = PLAYING;
                        }
@@ -332,7 +332,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                {
                        if (p_main->p_aout != NULL)
                        {
-                               p_main->p_aout->vol = 0;
+                               p_main->p_aout->i_vol = 0;
                        }
                        snooze(400000);
                        input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
@@ -344,7 +344,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                {
                        if (p_main->p_aout != NULL)
                        {
-                               p_main->p_aout->vol = 0;
+                               p_main->p_aout->i_vol = 0;
                        }
                        snooze(400000);
                        input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
@@ -357,22 +357,22 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                // adjust the volume
         if (p_main->p_aout != NULL) 
         {
-                       p_main->p_aout->vol = vol_val;
+                       p_main->p_aout->i_vol = vol_val;
                }
                break;
        case VOLUME_MUTE:
                // mute
         if (p_main->p_aout != NULL) 
            {
-                       if (p_main->p_aout->vol == 0)
+                       if (p_main->p_aout->i_vol == 0)
                        {
                                p_vol->SetEnabled(true);
-                               p_main->p_aout->vol = vol_val;
+                               p_main->p_aout->i_vol = vol_val;
                        }       
                        else
                        {
                                p_vol->SetEnabled(false);
-                               p_main->p_aout->vol = 0;
+                               p_main->p_aout->i_vol = 0;
                        }
                }
                break;
index 5c13ba2a73b80247a375b6f53c120d34c0ae951f..0766e1fea58f9a204c4a8dbaf08a47f91e519f8d 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/darwin.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index a5218f76f60f16217f4a12980bc6c2cbf52ed96e..de25fe21da24a82d10f4cc6ee68d3761daff78b4 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/dsp.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index b99127d1cb9cd3de687c62d262dcbbb9c5253454..5ee16de1bed178b0c38f468f084a07a12e96dcfc 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/dummy.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index b16686d391f4cf855c6d068a6750f7af37d5e546..e6653cbe90f0fd18e2ee9c2d3d4f73bdafb4ad95 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/dvd.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index 35861f0d683a095510b2240234709e963f3549e9..e3e5a4cd0c1ae60bc7f616be22790c6a5dd8b0bc 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/esd.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index d10037f5fd8255b0e3cb1805e8f0f2d49dbb3465..bc1ecfb4e6931abf12369dc17d88a3275f588b45 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/fb.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index 40f12b442cba154ac02c9024a853e0f10b9a5398..ccd4df6f89bec4750ec5494357031cf1a2de9639 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/ggi.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index ed4a5e4c6eb6f0855805dc09da9b27fa404b1778..11033e1ded4b923025e05ab2793972882a09d3a8 100644 (file)
@@ -35,4 +35,5 @@ $(BUILTIN_GLIDE): BUILTIN_%.o: %.c
 
 ../../lib/glide.a: $(BUILTIN_GLIDE)
        ar r $@ $^
+       $(RANLIB) $@
 
index 39789da6eab6c258029abeed29304eac93977c6f..5665090ee8f665b82d5e808dd9800a52d7e6437a 100644 (file)
@@ -35,4 +35,5 @@ $(BUILTIN_GNOME): BUILTIN_%.o: %.c
 
 ../../lib/gnome.a: $(BUILTIN_GNOME)
        ar r $@ $^
+       $(RANLIB) $@
 
index 64d89d4c05ff6426ab1c53217af8573603d4eef8..e3f6a635bb0e6c485262136cf38ff75ef67e551a 100644 (file)
@@ -2,7 +2,7 @@
  * gnome_callbacks.c : Callbacks for the Gnome plugin.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.c,v 1.24 2001/04/22 00:08:26 stef Exp $
+ * $Id: gnome_callbacks.c,v 1.25 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -1011,7 +1011,8 @@ on_disc_ok_clicked                     (GtkButton       *button,
                                          GTK_WIDGET(button), "disc_name" ) ) );
 
     /* "dvd:foo" has size 5 + strlen(foo) */
-    psz_source = malloc( 5 + strlen( psz_device ) );
+    psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+                           + strlen( psz_device ) + 1 /* "\0" */ );
     if( psz_source == NULL )
     {
         return;
@@ -1110,7 +1111,9 @@ on_network_ok_clicked                  (GtkButton       *button,
     }
 
     /* Allocate room for "protocol://server:port" */
-    psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 );
+    psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+                           + strlen( psz_server ) + 1 /* ":" */
+                           + 5 /* 0-65535 */ + 1 /* "\0" */ );
     if( psz_source == NULL )
     {
         return;
index 6c4a67b9ee70d683a2f56ffd3aef360da22b8b15..14a6afbd8324bb12c15dbb4bab3aa24b09618f07 100644 (file)
@@ -2,7 +2,7 @@
  * intf_gnome.c: Gnome interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.33 2001/04/29 02:48:51 stef Exp $
+ * $Id: intf_gnome.c,v 1.34 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -438,13 +438,14 @@ static gint GnomeLanguageMenus( gpointer          p_data,
                                 gint              i_cat,
                           void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
 {
+#define GNOME_LANGUAGE_MENU_SIZE 64
     intf_thread_t *     p_intf;
     GtkWidget *         p_menu;
     GtkWidget *         p_separator;
     GtkWidget *         p_item;
     GtkWidget *         p_item_active;
     GSList *            p_group;
-    char                psz_name[12];
+    char                psz_name[ GNOME_LANGUAGE_MENU_SIZE ];
     gint                i_item;
     gint                i;
 
@@ -463,7 +464,8 @@ static gint GnomeLanguageMenus( gpointer          p_data,
     p_menu = gtk_menu_new();
 
     /* special case for "off" item */
-    sprintf( psz_name, "Off" );
+    snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE, "Off" );
+    psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
 
     p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
     p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
@@ -494,7 +496,9 @@ static gint GnomeLanguageMenus( gpointer          p_data,
             strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc );
             if( psz_name[0] == '\0' )
             {
-                sprintf( psz_name, "Language %d", i_item );
+                snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE,
+                          "Language %d", i_item );
+                psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
             }
 
             p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
@@ -546,8 +550,9 @@ static gint GnomeLanguageMenus( gpointer          p_data,
 static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
                         void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) )
 {
+#define GNOME_ANGLE_MENU_SIZE 64
     intf_thread_t *     p_intf;
-    char                psz_name[12];
+    char                psz_name[ GNOME_ANGLE_MENU_SIZE ];
     GtkWidget *         p_angle_menu;
     GSList *            p_angle_group;
     GtkWidget *         p_item;
@@ -570,7 +575,8 @@ static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
          i_angle < p_intf->p_input->stream.p_selected_area->i_angle_nb ;
          i_angle++ )
     {
-        sprintf( psz_name, "Angle %d", i_angle + 1 );
+        snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, "Angle %d", i_angle + 1 );
+        psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
 
         p_item = gtk_radio_menu_item_new_with_label( p_angle_group,
                                                      psz_name );
@@ -657,13 +663,17 @@ static gint GnomeChapterMenu( gpointer p_data, GtkWidget * p_chapter,
                 gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item );
             }
 
-            sprintf( psz_name, "%d - %d", i_chapter + 1, i_chapter + 10);
+            snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
+                      "%d - %d", i_chapter + 1, i_chapter + 10);
+            psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
             p_menu_item = gtk_menu_item_new_with_label( psz_name );
             gtk_widget_show( p_menu_item );
             p_chapter_submenu = gtk_menu_new();
         }
 
-        sprintf( psz_name, "Chapter %d", i_chapter + 1 );
+        snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
+                  "Chapter %d", i_chapter + 1 );
+        psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
 
         p_item = gtk_radio_menu_item_new_with_label( p_chapter_group,
                                                      psz_name );
@@ -732,8 +742,9 @@ static gint GnomeTitleMenu( gpointer       p_data,
                             GtkWidget *    p_navigation, 
                             void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
 {
+#define GNOME_TITLE_MENU_SIZE 64
     intf_thread_t *     p_intf;
-    char                psz_name[12];
+    char                psz_name[ GNOME_TITLE_MENU_SIZE ];
     GtkWidget *         p_title_menu;
     GtkWidget *         p_title_submenu;
     GtkWidget *         p_title_item;
@@ -780,13 +791,17 @@ static gint GnomeTitleMenu( gpointer       p_data,
                 gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
             }
 
-            sprintf( psz_name, "%d - %d", i_title, i_title + 9 );
+            snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
+                      "%d - %d", i_title, i_title + 9 );
+            psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
             p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
             gtk_widget_show( p_title_menu_item );
             p_title_submenu = gtk_menu_new();
         }
 
-        sprintf( psz_name, "Title %d (%d)", i_title, p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
+        snprintf( psz_name, GNOME_TITLE_MENU_SIZE, "Title %d (%d)", i_title,
+                  p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
+        psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
 
         if( pf_toggle == on_menubar_title_toggle )
         {
@@ -835,15 +850,18 @@ static gint GnomeTitleMenu( gpointer       p_data,
                                          p_chapter_menu_item );
                     }
 
-                    sprintf( psz_name, "%d - %d", i_chapter + 1,
-                                                  i_chapter + 10);
+                    snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
+                              "%d - %d", i_chapter + 1, i_chapter + 10 );
+                    psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
                     p_chapter_menu_item =
                             gtk_menu_item_new_with_label( psz_name );
                     gtk_widget_show( p_chapter_menu_item );
                     p_chapter_submenu = gtk_menu_new();
                 }
 
-                sprintf( psz_name, "Chapter %d", i_chapter + 1 );
+                snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
+                          "Chapter %d", i_chapter + 1 );
+                psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
     
                 p_item = gtk_radio_menu_item_new_with_label(
                                                 p_chapter_group, psz_name );
@@ -924,7 +942,6 @@ static gint GnomeTitleMenu( gpointer       p_data,
                                         TRUE );
     }
 
-
     return TRUE;
 }
 
@@ -947,14 +964,15 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
 
     if( p_intf->p_sys->b_title_update )
     { 
-        char            psz_title[3];
+        char            psz_title[5];
 
         p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
                             p_intf->p_sys->p_window ), "menubar_title" ) );
         GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle );
 
-        snprintf( psz_title, 3, "%02d",
+        snprintf( psz_title, 5, "%d",
                   p_intf->p_input->stream.p_selected_area->i_id );
+        psz_title[ 4 ] = '\0';
         gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
 
         p_intf->p_sys->b_title_update = 0;
@@ -962,7 +980,7 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
 
     if( p_intf->p_sys->b_chapter_update )
     {
-        char            psz_chapter[3];
+        char            psz_chapter[5];
 
         p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
                              p_intf->p_sys->p_popup ), "popup_navigation" ) );
@@ -972,8 +990,9 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
                              p_intf->p_sys->p_window ), "menubar_chapter" ) );
         GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle );
 
-        snprintf( psz_chapter, 3, "%02d", 
+        snprintf( psz_chapter, 5, "%d", 
                   p_intf->p_input->stream.p_selected_area->i_part );
+        psz_chapter[ 4 ] = '\0';
         gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
 
         p_intf->p_sys->i_part =
index d1fb0abe1b4a882a78406bd127b04225f868a972..8cb6b849226d7ea1cc38d143850ee1988cc89d74 100644 (file)
@@ -33,4 +33,5 @@ include ../../Makefile.modules
 
 ../../lib/gtk.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index c4f091b94e49748944054bc78d388689970a2e99..25cd61897e1756ca2bdd09d44f5d4775258f6e60 100644 (file)
@@ -67,28 +67,33 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
 
 ../../lib/idct.a: $(BUILTIN_IDCT)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/idctclassic.a: $(BUILTIN_IDCTCLASSIC)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/idctmmx.a: $(BUILTIN_IDCTMMX)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/idctmmxext.a: $(BUILTIN_IDCTMMXEXT)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC)
 
 ../../lib/idctaltivec.a: $(BUILTIN_IDCTALTIVEC)
        ar r $@ $^
+       $(RANLIB) $@
 
index 2f048f6c456dc83f293644894ff7252946ec97ea..12af4d04027b9d20206d9ff092fb74f4e740cbad 100644 (file)
@@ -35,4 +35,5 @@ $(BUILTIN_MACOSX): BUILTIN_%.o: %.c
 
 ../../lib/macosx.a: $(BUILTIN_MACOSX)
        ar r $@ $^
+       $(RANLIB) $@
 
index 2e3732c531827b1e779e141e9f69c72a65421f53..60aabbbf2242f62bebe5906d945b5bb330182542 100644 (file)
@@ -535,7 +535,7 @@ void playorpause ( intf_thread_t *p_intf )
             {
                     if (p_main->p_aout != NULL)
                     {
-                            p_main->p_aout->vol = 0;
+                            p_main->p_aout->i_vol = 0;
                     }
                     p_main->p_vout->p_sys->playback_status = PAUSED;
                 SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPlay");
@@ -545,7 +545,7 @@ void playorpause ( intf_thread_t *p_intf )
             {
                     if (p_main->p_aout != NULL)
                     {
-                            p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val;
+                            p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
                     }
                     p_main->p_vout->p_sys->playback_status = PLAYING;
                 SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPause");
@@ -563,7 +563,7 @@ void stop ( intf_thread_t *p_intf )
             // silence the sound, otherwise very horrible
             if (p_main->p_aout != NULL)
             {
-                    p_main->p_aout->vol = 0;
+                    p_main->p_aout->i_vol = 0;
             }
             //snooze(400000);
             input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
@@ -659,7 +659,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
                     {
                             if (p_main->p_aout != NULL)
                             {
-                                    p_main->p_aout->vol = 0;
+                                    p_main->p_aout->i_vol = 0;
                             }
                             //snooze(400000);
                             input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
@@ -672,7 +672,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
                     {
                             if (p_main->p_aout != NULL)
                             {
-                                    p_main->p_aout->vol = 0;
+                                    p_main->p_aout->i_vol = 0;
                             }
                             //snooze(400000);
                             input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
@@ -706,7 +706,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
                // adjust the volume
                     if (p_main->p_aout != NULL) 
                     {
-                        p_main->p_aout->vol++;
+                        p_main->p_aout->i_vol++;
                     }
                     break;
 
@@ -714,7 +714,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
                // adjust the volume
                     if (p_main->p_aout != NULL) 
                     {
-                        p_main->p_aout->vol--;
+                        p_main->p_aout->i_vol--;
                     }
                     break;
 
@@ -722,16 +722,16 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
                 // mute
                     if (p_main->p_aout != NULL) 
                         {
-                                    if (p_main->p_aout->vol == 0)
+                                    if (p_main->p_aout->i_vol == 0)
                                     {
                                             //p_vol->SetEnabled(true);
-                                            p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val;
+                                            p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
                                     }  
                                     else
                                     {
                                             //p_vol->SetEnabled(false);
-                                            p_main->p_vout->p_sys->vol_val = p_main->p_aout->vol;
-                                            p_main->p_aout->vol = 0;
+                                            p_main->p_vout->p_sys->vol_val = p_main->p_aout->i_vol;
+                                            p_main->p_aout->i_vol = 0;
                                     }
                             }
                             break;
index 3d48c2fb7ce22a425388558ff7c6413c0b615c52..bd4c7379d295fd559dc011539f18ac0c23e21d85 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/mga.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index a5b25942b6cfc13f5eb447968d33a9c9239478bb..fb5f26d569c23b0f17cacacf35e3b4358ef1f419 100644 (file)
@@ -49,22 +49,26 @@ $(BUILTIN_MOTIONMMXEXT): BUILTIN_MOTIONMMXEXT_%.o: %.c
 
 ../../lib/motion.a: $(BUILTIN_MOTION)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/motionclassic.so: $(PLUGIN_MOTIONCLASSIC) $(PLUGIN_MOTIONCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/motionclassic.a: $(BUILTIN_MOTIONCLASSIC)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/motionmmx.a: $(BUILTIN_MOTIONMMX)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/motionmmxext.a: $(BUILTIN_MOTIONMMXEXT)
        ar r $@ $^
+       $(RANLIB) $@
 
index 281378158fe93221472ee1229944a9639ec3ee52..2e6a21a20e2b98bd46d9c3b8b8d0c7505c9f7941 100644 (file)
@@ -33,16 +33,19 @@ include ../../Makefile.modules
 
 ../../lib/es.a: $(BUILTIN_ES)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/ps.so: $(PLUGIN_PS)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/ps.a: $(BUILTIN_PS)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/ts.so: $(PLUGIN_TS)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_TS)
 
 ../../lib/ts.a: $(BUILTIN_TS)
        ar r $@ $^
+       $(RANLIB) $@
 
index 19f5c1a0ecffa89bf2cf2e23b1ee26e6f0ed15bd..ebc8b76b5ff72d263f1d53f1d4e83f89b4478043 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/null.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index 2b51fa6bed9eb9d71d53c26725c31ca6bfc54ae3..9d927f21b0caae29032d89b89d79c0c2419dd653 100644 (file)
@@ -22,13 +22,13 @@ $(PLUGIN_QT): %.o: .dep/%.dpp
 $(PLUGIN_QT): %.o: %.moc
        $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
 $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
-       moc -i $< -o $@
+       $(MOC) -i $< -o $@
 
 $(BUILTIN_QT): BUILTIN_%.o: .dep/%.dpp
 $(BUILTIN_QT): %.o: %.moc
        $(CC) $(CFLAGS) -DBUILTIN -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:BUILTIN_%.moc=%.cpp)
 $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
-       moc -i $< -o $@
+       $(MOC) -i $< -o $@
 
 #
 # Real targets
@@ -39,4 +39,5 @@ $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
 
 ../../lib/qt.a: $(BUILTIN_QT)
        ar r $@ $^
+       $(RANLIB) $@
 
index 183bacb3da58980c205afa5678503d6a847d16e5..18cad2fb1f4b648af9c2c5b3c03efa5f541084ad 100644 (file)
@@ -27,4 +27,5 @@ include ../../Makefile.modules
 
 ../../lib/sdl.a: $(BUILTIN_C)
        ar r $@ $^
+       $(RANLIB) $@
 
index c7603247e95ef82be0d35878f6acb9aa6a6a7b3c..2265660a10ce50b055cda96a758b2148fb41a918 100644 (file)
@@ -31,10 +31,12 @@ include ../../Makefile.modules
 
 ../../lib/ncurses.a: $(BUILTIN_NCURSES)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/rc.so: $(PLUGIN_RC)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
 
 ../../lib/rc.a: $(BUILTIN_RC)
        ar r $@ $^
+       $(RANLIB) $@
 
index b2d76423fe9ff6577456fff330961556bbcdb09c..f77afeb2d290dae9aed357350406432f4dea3061 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * intf_rc.cpp: rc interface
+ * intf_rc.cpp: remote control interface
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
  * $Id: intf_rc.cpp,v 0.1 2001/04/27 shurdeek
index d43c96c71dd8d974fc31072fd8c5d46bfea68dfd..8a2b4310c8efcd2b35828347e38eb254a3b28f58 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * rc.cpp : stdin/stdout plugin for vlc
+ * rc.cpp : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
  * $Id: rc.cpp,v 0.1 2001/04/27 shurdeek
@@ -62,7 +62,7 @@ void _M( intf_getfunctions )( function_list_t * p_function_list );
 MODULE_INIT
 {
     p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "rc interface module";
+    p_module->psz_longname = "remote control interface module";
     p_module->psz_version = VERSION;
 
     p_module->i_capabilities = MODULE_CAPABILITY_NULL
index 30a2426c95149b91147e10c8d2312698fd09d2b0..0c792f1d909a3080278242eac4412842b5578174 100644 (file)
@@ -42,6 +42,7 @@ endif
 
 ../../lib/x11.a: $(BUILTIN_X11)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/xvideo.so: $(PLUGIN_XVIDEO)
 ifeq ($(SYS),nto-qnx)
@@ -52,4 +53,5 @@ endif
 
 ../../lib/xvideo.a: $(BUILTIN_XVIDEO)
        ar r $@ $^
+       $(RANLIB) $@
 
index 7933f4cf5895a34f54617c113ec47521e7e4055c..6cd0ef1ecd2876017fbb8cfb5cb4092982ec1a73 100644 (file)
@@ -2,7 +2,7 @@
  * vout_xvideo.c: Xvideo video output display method
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: vout_xvideo.c,v 1.12 2001/04/27 19:29:11 massiot Exp $
+ * $Id: vout_xvideo.c,v 1.13 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Shane Harper <shanegh@optusnet.com.au>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -207,7 +207,7 @@ static int vout_Probe( probedata_t *p_data )
         return( 999 );
     }
 
-    return( 110 );
+    return( 60 );
 }
 
 /*****************************************************************************
index 2c92da815a538773d997404eb53e47bcc60fb5ed..229b7deaca230b71f90115a941ed279fa58c70b4 100644 (file)
@@ -32,10 +32,12 @@ include ../../Makefile.modules
 
 ../../lib/yuv.a: $(BUILTIN_YUV)
        ar r $@ $^
+       $(RANLIB) $@
 
 ../../lib/yuvmmx.so: $(PLUGIN_YUVMMX)
        $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ../../lib/yuvmmx.a: $(BUILTIN_YUVMMX)
        ar r $@ $^
+       $(RANLIB) $@
 
index 2b4dc49645001b6674233e8b6f4b5e9439225f56..278942cb0a422930e32a272c9763d653b877ca5d 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_decoder_thread.c: ac3 decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder_thread.c,v 1.30 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_decoder_thread.c,v 1.31 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Lespinasse <walken@zoy.org>
  *
@@ -97,7 +97,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
     /*
      * Initialize the output properties
      */
-    p_ac3dec_t->p_aout = p_config->p_aout;
     p_ac3dec_t->p_aout_fifo = NULL;
 
     /* Spawn the ac3 decoder thread */
@@ -120,8 +119,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
  *****************************************************************************/
 static int InitThread (ac3dec_thread_t * p_ac3dec_t)
 {
-    aout_fifo_t         aout_fifo;
-
     intf_DbgMsg("ac3dec debug: initializing ac3 decoder thread %p",p_ac3dec_t);
 
     p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream(
@@ -129,15 +126,10 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t)
             p_ac3dec_t->p_config->decoder_config.p_decoder_fifo,
             BitstreamCallback, (void *) p_ac3dec_t );
 
-    
-    aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
-    aout_fifo.i_channels = 2;
-    aout_fifo.b_stereo = 1;
-
-    aout_fifo.l_frame_size = AC3DEC_FRAME_SIZE;
-
     /* Creating the audio output fifo */
-    if ((p_ac3dec_t->p_aout_fifo = aout_CreateFifo(p_ac3dec_t->p_aout, &aout_fifo)) == NULL)
+    p_ac3dec_t->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
+                                               AC3DEC_FRAME_SIZE, NULL  );
+    if ( p_ac3dec_t->p_aout_fifo == NULL )
     {
         return -1;
     }
index 7501cacc15ae9def038a9a4d4c6950f758f10827..ae513746264b6404c22fad72cbfec80d559b0573 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_decoder_thread.h : ac3 decoder thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder_thread.h,v 1.5 2001/04/20 12:14:34 reno Exp $
+ * $Id: ac3_decoder_thread.h,v 1.6 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -44,14 +44,12 @@ typedef struct ac3dec_thread_s
     /*
      * Decoder properties
      */
-
     ac3dec_t            ac3_decoder;
 
     /*
      * Output properties
      */
     aout_fifo_t *       p_aout_fifo; /* stores the decompressed audio frames */
-    aout_thread_t *     p_aout;           /* needed to create the audio fifo */
 
 } ac3dec_thread_t;
 
index e5595a08221b4f20498e3a9b152a46696effe822..c9994492b7c14938a17d75942c9b7f21c7ed2e90 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_iec958.c: ac3 to spdif converter
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ac3_iec958.c,v 1.1 2001/04/29 02:48:51 stef Exp $
+ * $Id: ac3_iec958.c,v 1.2 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Juha Yrjola <jyrjola@cc.hut.fi>
@@ -102,72 +102,85 @@ static const frame_size_t p_frame_size_code[64] =
 /****************************************************************************
  * ac3_iec958_build_burst: builds an iec958/spdif frame based on an ac3 frame
  ****************************************************************************/
-void ac3_iec958_build_burst( int i_length, u8 * pi_data, u8 * pi_out )
+void ac3_iec958_build_burst( ac3_spdif_thread_t *p_spdif )
 {
-    const u8 pi_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E };
-
-    /* add the spdif headers */
-    memcpy( pi_out, pi_sync, 4 );
-    if( i_length )
-        pi_out[4] = 0x01;
-    else
-        pi_out[4] = 0;
-    pi_out[5] = 0x00;
-    pi_out[6] = ( i_length *8 ) & 0xFF;
-    pi_out[7] = ( ( i_length *8 ) >> 8 ) & 0xFF;
-
-    swab( pi_data, pi_out + 8, i_length );
-    /* adds zero to complete the spdif frame
+    const u8 p_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E };
+    int      i_length  = p_spdif->ac3_info.i_frame_size;
+#ifndef HAVE_SWAB
+    /* Skip the first byte if i_length is odd */
+    u16 * p_in  = (u16 *)( p_spdif->p_ac3 + ( i_length & 0x1 ) );
+    u16 * p_out = (u16 *)p_spdif->p_iec;
+#endif
+
+    /* Add the spdif headers */
+    memcpy( p_spdif->p_iec, p_sync, 4 );
+    p_spdif->p_iec[4] = i_length ? 0x01 : 0x00;
+    p_spdif->p_iec[5] = 0x00;
+    p_spdif->p_iec[6] = ( i_length * 8 ) & 0xFF;
+    p_spdif->p_iec[7] = ( ( i_length * 8 ) >> 8 ) & 0xFF;
+
+#ifdef HAVE_SWAB
+    swab( p_spdif->p_ac3, p_spdif->p_iec + 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( pi_out + 8 + i_length, 0, SPDIF_FRAME - 8 - i_length );
+    memset( p_spdif->p_iec + 8 + i_length, 0, SPDIF_FRAME_SIZE - 8 - i_length );
 }
 
 /****************************************************************************
  * ac3_iec958_parse_syncinfo: parse ac3 sync info
  ****************************************************************************/
-int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif,
-                               ac3_info_t *ac3_info,
-                               u8 * pi_ac3 )
+int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif )
 {
-    int             pi_sample_rates[4] = { 48000, 44100, 32000, -1 };
+    int             p_sample_rates[4] = { 48000, 44100, 32000, -1 };
     int             i_frame_rate_code;
     int             i_frame_size_code;
-//    u8 *            pi_tmp;
     sync_frame_t *  p_sync_frame;
 
-    /* find sync word */
+    /* Find sync word */
     while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 )
     {
         RemoveBits( &p_spdif->bit_stream, 8 );
     }
 
-    /* read sync frame */
-    pi_ac3 = malloc( sizeof(sync_frame_t) );
-    GetChunk( &p_spdif->bit_stream, pi_ac3, sizeof(sync_frame_t) );
-    p_sync_frame = (sync_frame_t*)pi_ac3;
+    /* Read sync frame */
+    GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3, sizeof(sync_frame_t) );
+    p_sync_frame = (sync_frame_t*)p_spdif->p_ac3;
 
-    /* compute frame rate */
+    /* Compute frame rate */
     i_frame_rate_code = (p_sync_frame->syncinfo.code >> 6) & 0x03;
-    ac3_info->i_sample_rate = pi_sample_rates[i_frame_rate_code];
-    if (ac3_info->i_sample_rate == -1)
+    p_spdif->ac3_info.i_sample_rate = p_sample_rates[i_frame_rate_code];
+    if( p_spdif->ac3_info.i_sample_rate == -1 )
     {
         return -1;
     }
 
-    /* compute frame size */
+    /* Compute frame size */
     i_frame_size_code = p_sync_frame->syncinfo.code & 0x3f;
-    ac3_info->i_frame_size = 2 *
+    p_spdif->ac3_info.i_frame_size = 2 *
         p_frame_size_code[i_frame_size_code].i_frame_size[i_frame_rate_code];
-    ac3_info->i_bit_rate = p_frame_size_code[i_frame_size_code].i_bit_rate;
+    p_spdif->ac3_info.i_bit_rate =
+        p_frame_size_code[i_frame_size_code].i_bit_rate;
 
     if( ( ( p_sync_frame->bsi.bsidmod >> 3 ) & 0x1f ) != 0x08 )
     {
         return -1;
     }
 
-    ac3_info->i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7;
-
-//    free( pi_tmp );
+    p_spdif->ac3_info.i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7;
 
     return 0;
 }
+
index 025507ae670c3db381e8fe989fb0ebebdac423f4..502ce3f27c37debe34ef2822f7a9097d3816a67c 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_iec958.h: ac3 to spdif converter headers
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ac3_iec958.h,v 1.1 2001/04/29 02:48:51 stef Exp $
+ * $Id: ac3_iec958.h,v 1.2 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Juha Yrjola <jyrjola@cc.hut.fi>
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  ****************************************************************************/
 
-#ifndef _AC3_IEC958_H
-#define _AC3_IEC958_H
-
 /****************************************************************************
  * information about ac3 frame
  ****************************************************************************/
-typedef struct ac3_info_s
-{
-    int i_bit_rate;
-    int i_frame_size;
-    int i_sample_rate;
-    int i_bs_mod;
-} ac3_info_t;
-
 typedef struct sync_frame_s
 {
     struct syncinfo
@@ -56,7 +45,6 @@ typedef struct sync_frame_s
 /****************************************************************************
  * Prototypes
  ****************************************************************************/
-void    ac3_iec958_build_burst      ( int, u8 *, u8 * );
-int     ac3_iec958_parse_syncinfo   ( struct ac3_spdif_thread_s *,
-                                      struct ac3_info_s *, u8 * );
-#endif
+void    ac3_iec958_build_burst      ( struct ac3_spdif_thread_s * );
+int     ac3_iec958_parse_syncinfo   ( struct ac3_spdif_thread_s * );
+
index 788e34c339116565434a5b1fa3b9254da8ce7ccd..907564f19a6c7266ffed14bebd9007be34a91a91 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.1 2001/04/29 02:48:51 stef Exp $
+ * $Id: ac3_spdif.c,v 1.2 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Juha Yrjola <jyrjola@cc.hut.fi>
@@ -69,20 +69,30 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
     intf_DbgMsg( "spdif debug: creating ac3 pass-through thread" );
 
     /* Allocate the memory needed to store the thread's structure */
-    if( ( p_spdif = malloc( sizeof(ac3_spdif_thread_t) ) ) == NULL )
+    p_spdif = malloc( sizeof(ac3_spdif_thread_t) );
+
+    if( p_spdif == NULL )
     {
         intf_ErrMsg ( "spdif error: not enough memory "
                       "for spdif_CreateThread() to create the new thread");
         return 0;
     }
     
+    /* Temporary buffer to store ac3 frames to be transformed */
+    p_spdif->p_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME_SIZE );
+
+    if( p_spdif->p_ac3 == NULL )
+    {
+        free( p_spdif->p_ac3 );
+        return 0;
+    }
+
     /*
      * Initialize the thread properties
      */
     p_spdif->p_config = p_config;
     p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo;
 
-    p_spdif->p_aout = p_config->p_aout;
     p_spdif->p_aout_fifo = NULL;
 
     /* Spawn the ac3 to spdif thread */
@@ -90,6 +100,7 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
                 (vlc_thread_func_t)RunThread, (void *)p_spdif))
     {
         intf_ErrMsg( "spdif error: can't spawn spdif thread" );
+        free( p_spdif->p_ac3 );
         free( p_spdif );
         return 0;
     }
@@ -108,27 +119,44 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
  ****************************************************************************/
 static int InitThread( ac3_spdif_thread_t * p_spdif )
 {
-    aout_fifo_t         aout_fifo;
-
     p_spdif->p_config->decoder_config.pf_init_bit_stream(
             &p_spdif->bit_stream,
             p_spdif->p_config->decoder_config.p_decoder_fifo,
             BitstreamCallback, (void*)p_spdif );
 
-    aout_fifo.i_type = AOUT_ADEC_MONO_FIFO;
-    aout_fifo.i_channels = 1;
-    aout_fifo.b_stereo = 0;
+    /* Creating the audio output fifo */
+    p_spdif->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_SPDIF_FIFO, 1, 0, 0,
+                                            SPDIF_FRAME_SIZE, NULL );
+
+    if( p_spdif->p_aout_fifo == NULL )
+    {
+        return -1;
+    }
 
-    aout_fifo.l_frame_size = SPDIF_FRAME;
+    intf_WarnMsg( 1, "spdif: aout fifo created" );
 
-    /* Creating the audio output fifo */
-    if( (p_spdif->p_aout_fifo =
-                aout_CreateFifo( p_spdif->p_aout, &aout_fifo ) ) == NULL )
+    /* Check stream properties */
+    if( ac3_iec958_parse_syncinfo( p_spdif ) < 0 )
     {
+        intf_ErrMsg( "spdif error: stream not valid");
+
+        aout_DestroyFifo( p_spdif->p_aout_fifo );
         return -1;
     }
 
-    intf_WarnMsg( 1, "aout fifo for spdif created" );
+    /* Check that we can handle the rate */
+    if( p_spdif->ac3_info.i_sample_rate != 48000 )
+    {
+        intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
+
+        aout_DestroyFifo( p_spdif->p_aout_fifo );
+        return -1;
+    }
+
+    GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3 + sizeof(sync_frame_t),
+        p_spdif->ac3_info.i_frame_size - sizeof(sync_frame_t) );
+    
+    vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
 
     return 0;
 }
@@ -139,34 +167,15 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
  ****************************************************************************/
 static void RunThread( ac3_spdif_thread_t * p_spdif )
 {
-    ac3_info_t  ac3_info;
-    u8 *        pi_ac3;
-    u8 *        pi_iec;
-    
-    InitThread( p_spdif );
-
-    /* temporary buffer to store ac3 frames to be transformed */
-    pi_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME );
-
-    /* check stream properties */
-    if( ac3_iec958_parse_syncinfo( p_spdif, &ac3_info, pi_ac3 ) < 0)
+    /* Initializing the spdif decoder thread */
+    if( InitThread( p_spdif ) )
     {
-        intf_ErrMsg( "spdif error: stream not valid");
-        exit(1);
-    }
-
-    if( ac3_info.i_sample_rate != 48000) {
-        intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
-        exit(1);
+         p_spdif->p_fifo->b_error = 1;
     }
 
-    GetChunk( &p_spdif->bit_stream, pi_ac3 + sizeof(sync_frame_t),
-        ac3_info.i_frame_size - sizeof(sync_frame_t) );
-    
-    vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
     while( !p_spdif->p_fifo->b_die && !p_spdif->p_fifo->b_error )
     {
-        /* handle the dates */
+        /* Handle the dates */
         if(DECODER_FIFO_START(*p_spdif->p_fifo)->i_pts)
         {
             p_spdif->p_aout_fifo->date[p_spdif->p_aout_fifo->l_end_frame] =
@@ -179,12 +188,12 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
                 LAST_MDATE;
         }
 
-        /* write in the first free packet of aout fifo */
-        pi_iec = (p_spdif->p_aout_fifo->buffer) + 
-            (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME );
+        /* Write in the first free packet of aout fifo */
+        p_spdif->p_iec = (p_spdif->p_aout_fifo->buffer) + 
+            (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE );
 
-        /* build burst to be sent to hardware decoder */
-        ac3_iec958_build_burst( ac3_info.i_frame_size, pi_ac3, pi_iec );
+        /* Build burst to be sent to hardware decoder */
+        ac3_iec958_build_burst( p_spdif );
 
         vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock);
 
@@ -193,18 +202,17 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
 
         vlc_mutex_unlock (&p_spdif->p_aout_fifo->data_lock);
 
-        /* find syncword */
+        /* Find syncword */
         while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 ) 
         {
             RemoveBits( &p_spdif->bit_stream, 8 );
         }
 
-        /* read data from bitstream */
-        GetChunk( &p_spdif->bit_stream, pi_ac3, ac3_info.i_frame_size );
+        /* Read data from bitstream */
+        GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3,
+                  p_spdif->ac3_info.i_frame_size );
     }
 
-    free( pi_ac3 );
-
     /* If b_error is set, the ac3 spdif thread enters the error loop */
     if( p_spdif->p_fifo->b_error )
     {
@@ -267,6 +275,7 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
 
     /* Destroy descriptor */
     free( p_spdif->p_config );
+    free( p_spdif->p_ac3 );
     free( p_spdif );
 
     intf_DbgMsg ("spdif debug: thread %p destroyed", p_spdif );
index 908989d27097a2e420ef4755fb69bcc8a10b9d22..9f9fdd278f3293a7c2dd03f7cc3b96be5b6b9c80 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_spdif.h: header for ac3 pass-through
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.h,v 1.1 2001/04/29 02:48:51 stef Exp $
+ * $Id: ac3_spdif.h,v 1.2 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  ****************************************************************************/
 
-#ifndef _AC3_SPDIF_H
-#define _AC3_SPDIF_H
+#define SPDIF_FRAME_SIZE 6144
 
-#define SPDIF_FRAME 6144
+typedef struct ac3_info_s
+{
+    int i_bit_rate;
+    int i_frame_size;
+    int i_sample_rate;
+    int i_bs_mod;
+} ac3_info_t;
 
 /*****************************************************************************
  * ac3_spdif_thread_t : ac3 pass-through thread descriptor
@@ -45,12 +50,18 @@ typedef struct ac3_spdif_thread_s
     /* The bit stream structure handles the PES stream at the bit level */
     bit_stream_t        bit_stream;
     int                 i_available;
-                
+
+    /*
+     * Decoder properties
+     */
+    ac3_info_t          ac3_info;
+    u8 *                p_ac3;
+    u8 *                p_iec;
+
     /*
      * Output properties
      */
-    aout_fifo_t *       p_aout_fifo;/* stores the decompressed audio frames */
-    aout_thread_t *     p_aout;         /* needed to create the audio fifo */
+    aout_fifo_t *       p_aout_fifo; /* stores the decompressed audio frames */
 
 } ac3_spdif_thread_t;
 
@@ -59,4 +70,3 @@ typedef struct ac3_spdif_thread_s
  *****************************************************************************/
 vlc_thread_t    spdif_CreateThread( adec_config_t * p_config );
 
-#endif
index ce728742c4c20edd7246b0aa36431b4fe490c383..763c3aac829147ed700dd8a3697dec787ee7a27b 100644 (file)
@@ -2,7 +2,7 @@
  * audio_decoder.c: MPEG audio decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_decoder.c,v 1.49 2001/04/25 10:22:32 massiot Exp $
+ * $Id: audio_decoder.c,v 1.50 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -102,7 +102,6 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
     /*
      * Initialize the output properties
      */
-    p_adec->p_aout = p_config->p_aout;
     p_adec->p_aout_fifo = NULL;
 
     /* Spawn the audio decoder thread */
@@ -128,21 +127,15 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
  *****************************************************************************/
 static int InitThread (adec_thread_t * p_adec)
 {
-    aout_fifo_t          aout_fifo;
-
     intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec);
 
     p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream,
         p_adec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
 
-    aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
-    aout_fifo.i_channels = 2;
-    aout_fifo.b_stereo = 1;
-    aout_fifo.l_frame_size = ADEC_FRAME_SIZE;
-
     /* Creating the audio output fifo */
-    if ( (p_adec->p_aout_fifo =
-                aout_CreateFifo(p_adec->p_aout, &aout_fifo)) == NULL ) 
+    p_adec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
+                                           ADEC_FRAME_SIZE, NULL );
+    if ( p_adec->p_aout_fifo == NULL ) 
     {
         return -1;
     }
@@ -164,9 +157,6 @@ static void RunThread (adec_thread_t * p_adec)
     intf_DbgMsg ( "adec debug: running audio decoder thread (%p) (pid == %i)",
                   p_adec, getpid() );
 
-    /* You really suck */
-    //msleep ( INPUT_PTS_DELAY );
-
     /* Initializing the audio decoder thread */
     p_adec->p_fifo->b_error = InitThread (p_adec);
 
index 1bb7530fa74e39e6aa076ebe88ef877c5176b1a7..07e93bb302d4557346267eb1c8ee18577d46e06d 100644 (file)
@@ -2,7 +2,7 @@
  * audio_decoder.h : audio decoder thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_decoder.h,v 1.6 2001/03/21 13:42:34 sam Exp $
+ * $Id: audio_decoder.h,v 1.7 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -52,7 +52,6 @@ typedef struct adec_thread_s
      * Output properties
      */
     struct aout_fifo_s *    p_aout_fifo;   /* stores the decompressed frames */
-    struct aout_thread_s *  p_aout;       /* needed to create the audio fifo */
 
 } adec_thread_t;
 
index f1e537ab2cb91a4cef620a45e1685bf6459b6a1c..a46d3cb85e6336f71791921c874e18024237b3c9 100644 (file)
@@ -2,7 +2,7 @@
  * aout_common.h: audio output inner functions
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_common.h,v 1.3 2001/04/29 02:48:51 stef Exp $
+ * $Id: aout_common.h,v 1.4 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -45,8 +45,6 @@ void aout_SpdifThread         ( aout_thread_t * p_aout );
         (integer) += (increment).l_euclidean_integer; \
     }
 
-#define FIFO p_aout->fifo[i_fifo]
-
 /*****************************************************************************
  * InitializeIncrement
  *****************************************************************************/
similarity index 59%
rename from src/audio_output/aout_fifo.c
rename to src/audio_output/aout_ext-dec.c
index 712a8461fc663f98244812743f10b811635f1a7d..337c6a5863e78008a14a8f6e48f918b53f88fbf3 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * aout_fifo.c : exported fifo management functions
+ * aout_ext-dec.c : exported fifo management functions
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_fifo.c,v 1.2 2001/03/21 13:42:34 sam Exp $
+ * $Id: aout_ext-dec.c,v 1.1 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
 #include "audio_output.h"
 #include "aout_common.h"
 
+#include "main.h"
+
 /*****************************************************************************
  * aout_CreateFifo
  *****************************************************************************/
-aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
+aout_fifo_t * aout_CreateFifo( int i_type, int i_channels, long l_rate,
+                               long l_units, long l_frame_size,
+                               void *p_buffer )
 {
+#define P_AOUT p_main->p_aout
     int i_fifo;
 
+    /* Spawn an audio output if there is none */
+    if( P_AOUT == NULL )
+    {
+        P_AOUT = aout_CreateThread( NULL );
+
+        if( P_AOUT == NULL )
+        {
+            return NULL;
+        }
+    }
+
     /* Take the fifos lock */
-    vlc_mutex_lock( &p_aout->fifos_lock );
+    vlc_mutex_lock( &P_AOUT->fifos_lock );
 
     /* Looking for a free fifo structure */
-    for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
+    for( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
     {
-        if ( p_aout->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO)
+        if( P_AOUT->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO )
         {
             /* Not very clever, but at least we know which fifo it is */
-            p_aout->fifo[i_fifo].i_fifo = i_fifo;
+            P_AOUT->fifo[i_fifo].i_fifo = i_fifo;
             break;
         }
     }
 
-    if ( i_fifo == AOUT_MAX_FIFOS )
+    if( i_fifo == AOUT_MAX_FIFOS )
     {
         intf_ErrMsg( "aout error: no fifo available" );
-        vlc_mutex_unlock( &p_aout->fifos_lock );
+        vlc_mutex_unlock( &P_AOUT->fifos_lock );
         return( NULL );
     }
 
     /* Initialize the new fifo structure */
-    switch ( p_aout->fifo[i_fifo].i_type = p_fifo->i_type )
+    switch ( P_AOUT->fifo[i_fifo].i_type = i_type )
     {
         case AOUT_INTF_MONO_FIFO:
         case AOUT_INTF_STEREO_FIFO:
-            p_aout->fifo[i_fifo].b_die = 0;
+            P_AOUT->fifo[i_fifo].b_die = 0;
 
-            p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels;
-            p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo;
-            p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
+            P_AOUT->fifo[i_fifo].i_channels = i_channels;
+            P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
+            P_AOUT->fifo[i_fifo].l_rate = l_rate;
 
-            p_aout->fifo[i_fifo].buffer = p_fifo->buffer;
+            P_AOUT->fifo[i_fifo].buffer = p_buffer;
 
-            p_aout->fifo[i_fifo].l_unit = 0;
-            InitializeIncrement( &p_aout->fifo[i_fifo].unit_increment,
-                                 p_fifo->l_rate, p_aout->l_rate );
-            p_aout->fifo[i_fifo].l_units = p_fifo->l_units;
+            P_AOUT->fifo[i_fifo].l_unit = 0;
+            InitializeIncrement( &P_AOUT->fifo[i_fifo].unit_increment,
+                                 l_rate, P_AOUT->l_rate );
+            P_AOUT->fifo[i_fifo].l_units = l_units;
             break;
 
         case AOUT_ADEC_MONO_FIFO:
         case AOUT_ADEC_STEREO_FIFO:
-            p_aout->fifo[i_fifo].b_die = 0;
+            P_AOUT->fifo[i_fifo].b_die = 0;
 
-            p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels;
-            p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo;
-            p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
+            P_AOUT->fifo[i_fifo].i_channels = i_channels;
+            P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
+            P_AOUT->fifo[i_fifo].l_rate = l_rate;
 
-            p_aout->fifo[i_fifo].l_frame_size = p_fifo->l_frame_size;
+            P_AOUT->fifo[i_fifo].l_frame_size = l_frame_size;
             /* Allocate the memory needed to store the audio frames. 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_aout->fifo[i_fifo].buffer = malloc( sizeof(s16)*(AOUT_FIFO_SIZE+1)*p_fifo->l_frame_size );
-            if ( p_aout->fifo[i_fifo].buffer == NULL )
+             * 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_AOUT->fifo[i_fifo].buffer = malloc( sizeof(s16) *
+                                   ( AOUT_FIFO_SIZE + 1 ) * l_frame_size );
+            if ( P_AOUT->fifo[i_fifo].buffer == NULL )
             {
                 intf_ErrMsg( "aout error: cannot create frame buffer" );
-                p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
-                vlc_mutex_unlock( &p_aout->fifos_lock );
+                P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+                vlc_mutex_unlock( &P_AOUT->fifos_lock );
                 return( NULL );
             }
 
             /* Allocate the memory needed to store the dates of the frames */
-            p_aout->fifo[i_fifo].date = (mtime_t *)malloc( sizeof(mtime_t)*(AOUT_FIFO_SIZE+1) );
-            if ( p_aout->fifo[i_fifo].date == NULL )
+            P_AOUT->fifo[i_fifo].date =
+                           malloc( sizeof(mtime_t) * ( AOUT_FIFO_SIZE +  1) );
+
+            if ( P_AOUT->fifo[i_fifo].date == NULL )
             {
                 intf_ErrMsg( "aout error: cannot create date buffer");
-                free( p_aout->fifo[i_fifo].buffer );
-                p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
-                vlc_mutex_unlock( &p_aout->fifos_lock );
+                free( P_AOUT->fifo[i_fifo].buffer );
+                P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+                vlc_mutex_unlock( &P_AOUT->fifos_lock );
                 return( NULL );
             }
 
             /* 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_aout->fifo[i_fifo].l_start_frame = 0;
-            /* p_aout->fifo[i_fifo].l_next_frame = 0; */
-            p_aout->fifo[i_fifo].l_end_frame = 0;
+            P_AOUT->fifo[i_fifo].l_start_frame = 0;
+            /* P_AOUT->fifo[i_fifo].l_next_frame = 0; */
+            P_AOUT->fifo[i_fifo].l_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_aout->fifo[i_fifo].b_start_frame = 0;
-            p_aout->fifo[i_fifo].b_next_frame = 0;
+            P_AOUT->fifo[i_fifo].b_start_frame = 0;
+            P_AOUT->fifo[i_fifo].b_next_frame = 0;
             break;
 
         default:
-            intf_ErrMsg( "aout error: unknown fifo type 0x%x", p_aout->fifo[i_fifo].i_type );
-            p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
-            vlc_mutex_unlock( &p_aout->fifos_lock );
+            intf_ErrMsg( "aout error: unknown fifo type 0x%x",
+                         P_AOUT->fifo[i_fifo].i_type );
+            P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+            vlc_mutex_unlock( &P_AOUT->fifos_lock );
             return( NULL );
     }
 
     /* Release the fifos lock */
-    vlc_mutex_unlock( &p_aout->fifos_lock );
+    vlc_mutex_unlock( &P_AOUT->fifos_lock );
 
     intf_WarnMsg( 2, "aout info: fifo #%i allocated, %i channels, rate %li",
-                  p_aout->fifo[i_fifo].i_fifo, p_aout->fifo[i_fifo].i_channels, p_aout->fifo[i_fifo].l_rate );
+                  P_AOUT->fifo[i_fifo].i_fifo, P_AOUT->fifo[i_fifo].i_channels,
+                  P_AOUT->fifo[i_fifo].l_rate );
 
     /* Return the pointer to the fifo structure */
-    return( &FIFO );
+    return( &P_AOUT->fifo[i_fifo] );
+#undef P_AOUT
 }
 
 /*****************************************************************************
index 26387d6e61c99ba73827af28a19f5c9f118be1b7..a0a41a230d7417a03d677d92631c2e29301bb748 100644 (file)
@@ -82,7 +82,7 @@ void aout_S16StereoThread( aout_thread_t * p_aout )
         {
             ((s16 *)p_aout->buffer)[l_buffer] =
                      (s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS )
-                            * p_aout->vol / 256 ) ;
+                            * p_aout->i_vol / 256 ) ;
             p_aout->s32_buffer[l_buffer] = 0;
         }
 
index e25cf1768177a1cfea1480e57b28fdaf0b2ae323..d23de0d2f2c35bfe156eb1ec7f70af8b19687c78 100644 (file)
@@ -2,7 +2,7 @@
  * aout_u8.c: 8 bit unsigned audio output functions
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_u8.c,v 1.2 2001/03/21 13:42:34 sam Exp $
+ * $Id: aout_u8.c,v 1.3 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -77,7 +77,7 @@ void aout_U8MonoThread( aout_thread_t * p_aout )
 
         for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
         {
-            ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->vol / 256 );
+            ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->i_vol / 256 );
             p_aout->s32_buffer[l_buffer] = 0;
         }
 
@@ -131,7 +131,7 @@ void aout_U8StereoThread( aout_thread_t * p_aout )
 
         for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
         {
-            ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->vol / 256 );
+            ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_vol / 256 );
             p_aout->s32_buffer[l_buffer] = 0;
         }
         l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
index 79892cd664cc78f79d453cf805d356cee5729df9..6ad459b7d0662b41253a30ed844b67722c3592c6 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.c : audio output thread
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: audio_output.c,v 1.58 2001/04/29 02:48:51 stef Exp $
+ * $Id: audio_output.c,v 1.59 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *
@@ -82,8 +82,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     }
 
     /* Choose the best module */
-    p_aout->p_module = module_Need( p_main->p_bank,
-                                    MODULE_CAPABILITY_AOUT, NULL );
+    p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT, NULL );
 
     if( p_aout->p_module == NULL )
     {
@@ -105,7 +104,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
      */
     if ( p_aout->pf_open( p_aout ) )
     {
-        module_Unneed( p_main->p_bank, p_aout->p_module );
+        module_Unneed( p_aout->p_module );
         free( p_aout );
         return( NULL );
     }
@@ -114,13 +113,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     {
         intf_ErrMsg( "aout error: null sample rate" );
         p_aout->pf_close( p_aout );
-        module_Unneed( p_main->p_bank, p_aout->p_module );
+        module_Unneed( p_aout->p_module );
         free( p_aout );
         return( NULL );
     }
 
     /* special setting for ac3 pass-through mode */
-    if( p_main->b_spdif )
+    if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
     {
         p_aout->i_format   = AOUT_FMT_AC3;
         p_aout->i_channels = 1;
@@ -133,13 +132,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     if ( p_aout->pf_setformat( p_aout ) )
     {
         p_aout->pf_close( p_aout );
-        module_Unneed( p_main->p_bank, p_aout->p_module );
+        module_Unneed( p_aout->p_module );
         free( p_aout );
         return( NULL );
     }
 
     /* Initialize the volume level */
-    p_aout->vol = VOLUME_DEFAULT;
+    p_aout->i_vol = VOLUME_DEFAULT;
     
     /* FIXME: maybe it would be cleaner to change SpawnThread prototype
      * see vout to handle status correctly ?? however, it is not critical since
@@ -147,7 +146,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
     if( aout_SpawnThread( p_aout ) )
     {
         p_aout->pf_close( p_aout );
-        module_Unneed( p_main->p_bank, p_aout->p_module );
+        module_Unneed( p_aout->p_module );
         free( p_aout );
         return( NULL );
     }
@@ -337,7 +336,7 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
     p_aout->pf_close( p_aout );
 
     /* Release the aout module */
-    module_Unneed( p_main->p_bank, p_aout->p_module );
+    module_Unneed( p_aout->p_module );
 
     /* Free structure */
     free( p_aout );
index 1c29372b6505289678d9a327c7047201fc9a6810..43c0b9fbc5bcdf73ae119c1441685bef5e6ec1c5 100644 (file)
@@ -4,7 +4,7 @@
  * decoders.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.103 2001/04/28 23:19:19 henri Exp $
+ * $Id: input.c,v 1.104 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -144,7 +144,6 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
     p_input->stream.control.b_bw = 0;
 
     /* Initialize default settings for spawned decoders */
-    p_input->p_default_aout = p_main->p_aout;
     p_input->p_default_vout = p_main->p_vout;
 
     /* Create thread and set locks. */
@@ -318,8 +317,7 @@ static int InitThread( input_thread_t * p_input )
     p_input->c_packets_trashed          = 0;
 #endif
 
-    p_input->p_input_module = module_Need( p_main->p_bank,
-                                           MODULE_CAPABILITY_INPUT,
+    p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT,
                                            (probedata_t *)p_input );
 
     if( p_input->p_input_module == NULL )
@@ -350,7 +348,7 @@ static int InitThread( input_thread_t * p_input )
     {
         /* We barfed -- exit nicely */
         p_input->pf_close( p_input );
-        module_Unneed( p_main->p_bank, p_input->p_input_module );
+        module_Unneed( p_input->p_input_module );
         return( -1 );
     }
 
@@ -360,7 +358,7 @@ static int InitThread( input_thread_t * p_input )
     {
         /* We barfed -- exit nicely */
         p_input->pf_close( p_input );
-        module_Unneed( p_main->p_bank, p_input->p_input_module );
+        module_Unneed( p_input->p_input_module );
         return( -1 );
     }
 
@@ -414,7 +412,7 @@ static void EndThread( input_thread_t * p_input )
     p_input->pf_close( p_input );
 
     /* Release modules */
-    module_Unneed( p_main->p_bank, p_input->p_input_module );
+    module_Unneed( p_input->p_input_module );
 
 }
 
index ca1996bbd608ad992068f4cbead70946a7567644..12c6efcbdf96911d3e70a30ad11714406c827e0d 100644 (file)
@@ -2,7 +2,7 @@
  * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.53 2001/04/29 02:48:51 stef Exp $
+ * $Id: input_programs.c,v 1.54 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -174,8 +174,6 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input,
 
     p_input->stream.pp_programs[i_pgrm_index]->p_vout
                                             = p_input->p_default_vout;
-    p_input->stream.pp_programs[i_pgrm_index]->p_aout
-                                            = p_input->p_default_aout;
 
     if( i_data_len )
     {
@@ -580,7 +578,7 @@ static adec_config_t * GetAdecConfig( input_thread_t * p_input,
         intf_ErrMsg( "Unable to allocate memory in GetAdecConfig" );
         return( NULL );
     }
-    p_config->p_aout = p_input->p_default_aout;
+
     if( InitDecConfig( p_input, p_es, &p_config->decoder_config ) == -1 )
     {
         free( p_config );
@@ -661,13 +659,13 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
     case AC3_AUDIO_ES:
         if( p_main->b_audio )
         {
-            if( !p_main->b_spdif )
+            if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
             {
-                decoder.pf_create_thread = ac3dec_CreateThread;
+                decoder.pf_create_thread = spdif_CreateThread;
             }
             else
             {
-                decoder.pf_create_thread = spdif_CreateThread;
+                decoder.pf_create_thread = ac3dec_CreateThread;
             }
 
             p_config = (void *)GetAdecConfig( p_input, p_es );
index 402eede8adf4ecde2046b77b00ff8d1b33afc682..b627e8c2a367bb12d46b25860240a24936e853d5 100644 (file)
@@ -4,7 +4,7 @@
  * interface, such as command line.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: interface.c,v 1.74 2001/04/30 15:00:59 massiot Exp $
+ * $Id: interface.c,v 1.75 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -81,8 +81,7 @@ intf_thread_t* intf_Create( void )
     }
 
     /* Choose the best module */
-    p_intf->p_module = module_Need( p_main->p_bank,
-                                    MODULE_CAPABILITY_INTF, NULL );
+    p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF, NULL );
 
     if( p_intf->p_module == NULL )
     {
@@ -111,7 +110,7 @@ intf_thread_t* intf_Create( void )
     if( p_intf->pf_open( p_intf ) )
     {
         intf_ErrMsg("intf error: cannot create interface");
-        module_Unneed( p_main->p_bank, p_intf->p_module );
+        module_Unneed( p_intf->p_module );
         free( p_intf );
         return( NULL );
     }
@@ -142,7 +141,7 @@ static void intf_Manage( intf_thread_t *p_intf )
     intf_FlushMsg();
 
     /* Manage module bank */
-    module_ManageBank( p_main->p_bank );
+    module_ManageBank( );
 
     if( ( p_intf->p_input != NULL ) &&
             ( p_intf->p_input->b_error || p_intf->p_input->b_eof ) )
@@ -205,7 +204,7 @@ void intf_Destroy( intf_thread_t *p_intf )
     }
          
     /* Unlock module */
-    module_Unneed( p_main->p_bank, p_intf->p_module );
+    module_Unneed( p_intf->p_module );
 
     vlc_mutex_destroy( &p_intf->change_lock );
 
@@ -336,21 +335,21 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
  * half handled directly by the plugins. We should decide what to do. */        
         break;
     case INTF_KEY_INC_VOLUME:                                    /* volume + */
-        if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLUME_MAX) )
-            p_main->p_aout->vol += VOLUME_STEP;
+        if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol < VOLUME_MAX) )
+            p_main->p_aout->i_vol += VOLUME_STEP;
         break;
     case INTF_KEY_DEC_VOLUME:                                    /* volume - */
-        if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLUME_STEP) )
-            p_main->p_aout->vol -= VOLUME_STEP;
+        if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol > VOLUME_STEP) )
+            p_main->p_aout->i_vol -= VOLUME_STEP;
         break;
     case INTF_KEY_TOGGLE_VOLUME:                              /* toggle mute */
-        if( (p_main->p_aout != NULL) && (p_main->p_aout->vol))
+        if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol))
         {
-            i_volbackup = p_main->p_aout->vol;
-            p_main->p_aout->vol = 0;
+            i_volbackup = p_main->p_aout->i_vol;
+            p_main->p_aout->i_vol = 0;
         }
-        else if( (p_main->p_aout != NULL) && (!p_main->p_aout->vol))
-            p_main->p_aout->vol = i_volbackup;
+        else if( (p_main->p_aout != NULL) && (!p_main->p_aout->i_vol))
+            p_main->p_aout->i_vol = i_volbackup;
         break;
     case INTF_KEY_DEC_GAMMA:                                      /* gamma - */
         if( (p_main->p_vout != NULL) && (p_main->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
index 6b04662b747b6fc7a237879eb0fecf3cf6f5c248..bfdc998c994e18282d15347326bec9d475e70666 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.90 2001/04/29 02:48:51 stef Exp $
+ * $Id: main.c,v 1.91 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -182,9 +182,11 @@ static const struct option longopts[] =
 static const char *psz_shortopts = "hHvgt:T:u:a:s:c:I:A:V:";
 
 /*****************************************************************************
- * Global variable program_data - this is the one and only, see main.h
+ * Global variable program_data - these are the only ones, see main.h and
+ * modules.h
  *****************************************************************************/
 main_t *p_main;
+bank_t *p_bank;
 
 /*****************************************************************************
  * Local prototypes
@@ -214,8 +216,18 @@ static int  CPUCapabilities         ( void );
 int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 {
     main_t  main_data;                      /* root of all data - see main.h */
+    bank_t  module_bank;
 
-    p_main = &main_data;                       /* set up the global variable */
+    p_main = &main_data;                      /* set up the global variables */
+    p_bank = &module_bank;
+
+    /*
+     * Initialize the main structure
+     */
+    p_main->i_cpu_capabilities = CPUCapabilities();
+    
+    p_main->p_aout = NULL;
+    p_main->p_vout = NULL;
 
     /*
      * System specific initialization code
@@ -224,8 +236,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     system_Create( &i_argc, ppsz_argv, ppsz_env );
 #endif
 
-    p_main->i_cpu_capabilities = CPUCapabilities();
-    
     /*
      * Test if our code is likely to run on this CPU 
      */
@@ -272,7 +282,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Initialize playlist and get commandline files
      */
-    p_main->p_playlist = intf_PlaylistCreate( );
+    p_main->p_playlist = intf_PlaylistCreate();
     if( !p_main->p_playlist )
     {
         intf_ErrMsg( "playlist error: playlist initialization failed" );
@@ -289,15 +299,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Initialize module bank
      */
-    p_main->p_bank = module_CreateBank( );
-    if( !p_main->p_bank )
-    {
-        intf_ErrMsg( "module error: module bank initialization failed" );
-        intf_PlaylistDestroy( p_main->p_playlist );
-        intf_MsgDestroy();
-        return( errno );
-    }
-    module_InitBank( p_main->p_bank );
+    module_InitBank();
 
     /*
      * Initialize shared resources and libraries
@@ -317,7 +319,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     if( !p_main->p_intf )
     {
         intf_ErrMsg( "intf error: interface initialization failed" );
-        module_DestroyBank( p_main->p_bank );
+        module_EndBank();
         intf_PlaylistDestroy( p_main->p_playlist );
         intf_MsgDestroy();
         return( errno );
@@ -328,58 +330,28 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
      */
     InitSignalHandler();
 
-    /*
-     * Open audio device and start aout thread
-     */
-    if( p_main->b_audio )
-    {
-        p_main->p_aout = aout_CreateThread( NULL );
-        if( p_main->p_aout == NULL )
-        {
-            /* On error during audio initialization, switch off audio */
-            intf_ErrMsg( "aout error: audio initialization failed,"
-                         " audio is deactivated" );
-            p_main->b_audio = 0;
-        }
-    }
-
-    /*
-     * Open video device and start vout thread
-     */
-    if( p_main->b_video )
-    {
-        p_main->p_vout = vout_CreateThread( NULL );
-        if( p_main->p_vout == NULL )
-        {
-            /* On error during video initialization, switch off video */
-            intf_ErrMsg( "vout error: video initialization failed,"
-                         " video is deactivated" );
-            p_main->b_video = 0;
-        }
-    }
-
-    /* Flush messages before entering the main loop */
-    intf_FlushMsg();
-
     /*
      * This is the main loop
      */
     p_main->p_intf->pf_run( p_main->p_intf );
 
+    /*
+     * Finished, destroy the interface
+     */
     intf_Destroy( p_main->p_intf );
 
     /*
-     * Close video device
+     * Close all video devices
      */
-    if( p_main->b_video )
+    if( p_main->p_vout != NULL )
     {
         vout_DestroyThread( p_main->p_vout, NULL );
     }
 
     /*
-     * Close audio device
+     * Close all audio devices
      */
-    if( p_main->b_audio )
+    if( p_main->p_aout != NULL )
     {
         aout_DestroyThread( p_main->p_aout, NULL );
     }
@@ -395,7 +367,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Free module bank
      */
-    module_DestroyBank( p_main->p_bank );
+    module_EndBank();
 
     /*
      * Free playlist
@@ -524,7 +496,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
     p_main->b_audio     = 1;
     p_main->b_video     = 1;
     p_main->b_channels  = 0;
-    p_main->b_spdif     = 0;
 
     p_main->i_warning_level = 4;
 
@@ -609,7 +580,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
             main_PutIntVariable( AOUT_STEREO_VAR, 0 );
             break;
         case OPT_SPDIF:                                           /* --spdif */
-            p_main->b_spdif = 1;
+            main_PutIntVariable( AOUT_SPDIF_VAR, 1 );
             break;
 
         /* Video options */
@@ -763,7 +734,7 @@ static void Usage( int i_fashion )
           "\n      --noaudio                  \tdisable audio"
           "\n  -A, --aout <module>            \taudio output method"
           "\n      --stereo, --mono           \tstereo/mono audio"
-          "\n      --spdif                    \tac3 pass-through mode"
+          "\n      --spdif                    \tAC3 pass-through mode"
           "\n"
           "\n      --novideo                  \tdisable video"
           "\n  -V, --vout <module>            \tvideo output method"
@@ -809,6 +780,7 @@ static void Usage( int i_fashion )
         "\n  " AOUT_METHOD_VAR "=<method name>        \taudio method"
         "\n  " AOUT_DSP_VAR "=<filename>              \tdsp device path"
         "\n  " AOUT_STEREO_VAR "={1|0}                \tstereo or mono output"
+        "\n  " AOUT_SPDIF_VAR "={1|0}                 \tAC3 pass-through mode"
         "\n  " AOUT_RATE_VAR "=<rate>             \toutput rate" );
 
     /* Video parameters */
index 06498ef061f2836e5e88dee84293db13a9759951..9a3c3d260c988bf5f699b7bcbfed187cfd2bcccd 100644 (file)
@@ -2,7 +2,7 @@
  * lpcm_decoder_thread.c: lpcm decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: lpcm_decoder_thread.c,v 1.13 2001/04/06 09:15:48 sam Exp $
+ * $Id: lpcm_decoder_thread.c,v 1.14 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -84,7 +84,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
     /*
      * Initialize the output properties
      */
-    p_lpcmdec->p_aout = p_config->p_aout;
     p_lpcmdec->p_aout_fifo = NULL;
 
     /* Spawn the lpcm decoder thread */
@@ -105,7 +104,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
  *****************************************************************************/
 static int InitThread (lpcmdec_thread_t * p_lpcmdec)
 {
-    aout_fifo_t         aout_fifo;
     lpcm_byte_stream_t * byte_stream;
 
     intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p", p_lpcmdec );
@@ -127,14 +125,11 @@ static int InitThread (lpcmdec_thread_t * p_lpcmdec)
     byte_stream->info = p_lpcmdec;
     vlc_mutex_unlock (&p_lpcmdec->p_fifo->data_lock);
 
-    aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
-    aout_fifo.i_channels = 2;
-    aout_fifo.b_stereo = 1;
-
-    aout_fifo.l_frame_size = LPCMDEC_FRAME_SIZE;
-
     /* Creating the audio output fifo */
-    if ((p_lpcmdec->p_aout_fifo = aout_CreateFifo(p_lpcmdec->p_aout, &aout_fifo)) == NULL) {
+    p_lpcmdec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
+                                              LPCMDEC_FRAME_SIZE, NULL  );
+    if ( p_lpcmdec->p_aout_fifo == NULL )
+    {
         return -1;
     }
 
index 22871319b30e09cb5a46f234c9781a03340a204f..30b95b449a587646c34483243f1098748d50d4ec 100644 (file)
@@ -2,7 +2,7 @@
  * lpcm_decoder_thread.h : lpcm decoder thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: lpcm_decoder_thread.h,v 1.4 2001/03/21 13:42:34 sam Exp $
+ * $Id: lpcm_decoder_thread.h,v 1.5 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -43,14 +43,12 @@ typedef struct lpcmdec_thread_s
     /*
      * Decoder properties
      */
-
     lpcmdec_t            lpcm_decoder;
 
     /*
      * Output properties
      */
     aout_fifo_t *       p_aout_fifo; /* stores the decompressed audio frames */
-    aout_thread_t *     p_aout;           /* needed to create the audio fifo */
 
 } lpcmdec_thread_t;
 
@@ -58,3 +56,4 @@ typedef struct lpcmdec_thread_s
  * Prototypes
  *****************************************************************************/
 vlc_thread_t            lpcmdec_CreateThread( adec_config_t * p_config );
+
index 50b9dd8667f6fcaa972e132484746b8c08467ff4..7ae18bc477f19e3935d363c63b93d5cc2b178de3 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Built-in and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.27 2001/04/28 03:36:25 sam Exp $
+ * $Id: modules.c,v 1.28 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
 #include "intf_msg.h"
 #include "modules.h"
 #ifdef HAVE_DYNAMIC_PLUGINS
-#include "modules_core.h"
+#   include "modules_core.h"
 #endif
 #include "modules_builtin.h"
 
 /* Local prototypes */
 #ifdef HAVE_DYNAMIC_PLUGINS
-static int AllocatePluginModule ( module_bank_t *, char * );
+static int AllocatePluginModule ( char * );
 #endif
-static int AllocateBuiltinModule( module_bank_t *,
-                                  int ( * ) ( module_t * ),
+static int AllocateBuiltinModule( int ( * ) ( module_t * ),
                                   int ( * ) ( module_t * ),
                                   int ( * ) ( module_t * ) );
-static int DeleteModule ( module_bank_t * p_bank, module_t * );
+static int DeleteModule ( module_t * );
 static int LockModule   ( module_t * );
 static int UnlockModule ( module_t * );
 #ifdef HAVE_DYNAMIC_PLUGINS
@@ -80,27 +79,13 @@ static int HideModule   ( module_t * );
 static int CallSymbol   ( module_t *, char * );
 #endif
 
-/*****************************************************************************
- * module_CreateBank: create the module bank.
- *****************************************************************************
- * This function creates a module bank structure.
- *****************************************************************************/
-module_bank_t * module_CreateBank( void )
-{
-    module_bank_t * p_bank;
-
-    p_bank = malloc( sizeof( module_bank_t ) );
-
-    return( p_bank );
-}
-
 /*****************************************************************************
  * module_InitBank: create the module bank.
  *****************************************************************************
  * This function creates a module bank structure and fills it with the
  * built-in modules, as well as all the plugin modules it can find.
  *****************************************************************************/
-void module_InitBank( module_bank_t * p_bank )
+void module_InitBank( )
 {
 #ifdef HAVE_DYNAMIC_PLUGINS
     static char * path[] = { ".", "lib", PLUGIN_PATH, NULL, NULL };
@@ -120,8 +105,6 @@ void module_InitBank( module_bank_t * p_bank )
     p_bank->first = NULL;
     vlc_mutex_init( &p_bank->lock );
 
-    intf_WarnMsg( 1, "module: module bank initialized" );
-
     intf_WarnMsg( 2, "module: checking built-in modules" );
 
     ALLOCATE_ALL_BUILTINS();
@@ -178,7 +161,7 @@ void module_InitBank( module_bank_t * p_bank )
 
                     /* We created a nice filename -- now we just try to load
                      * it as a plugin module. */
-                    AllocatePluginModule( p_bank, psz_file );
+                    AllocatePluginModule( psz_file );
 
                     /* We don't care if the allocation succeeded */
                     free( psz_file );
@@ -198,22 +181,24 @@ void module_InitBank( module_bank_t * p_bank )
     }
 #endif /* HAVE_DYNAMIC_PLUGINS */
 
+    intf_WarnMsg( 1, "module: module bank initialized" );
+
     return;
 }
 
 /*****************************************************************************
- * module_DestroyBank: destroy the module bank.
+ * module_EndBank: destroy the module bank.
  *****************************************************************************
  * This function unloads all unused plugin modules and removes the module
  * bank in case of success.
  *****************************************************************************/
-void module_DestroyBank( module_bank_t * p_bank )
+void module_EndBank( )
 {
     module_t * p_next;
 
     while( p_bank->first != NULL )
     {
-        if( DeleteModule( p_bank, p_bank->first ) )
+        if( DeleteModule( p_bank->first ) )
         {
             /* Module deletion failed */
             intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
@@ -228,9 +213,6 @@ void module_DestroyBank( module_bank_t * p_bank )
 
     /* Destroy the lock */
     vlc_mutex_destroy( &p_bank->lock );
-    
-    /* We can free the module bank */
-    free( p_bank );
 
     return;
 }
@@ -241,7 +223,7 @@ void module_DestroyBank( module_bank_t * p_bank )
  * This function resets the module bank by unloading all unused plugin
  * modules.
  *****************************************************************************/
-void module_ResetBank( module_bank_t * p_bank )
+void module_ResetBank( )
 {
     intf_ErrMsg( "FIXME: module_ResetBank unimplemented" );
     return;
@@ -253,7 +235,7 @@ void module_ResetBank( module_bank_t * p_bank )
  * This function parses the module bank and hides modules that have been
  * unused for a while.
  *****************************************************************************/
-void module_ManageBank( module_bank_t * p_bank )
+void module_ManageBank( )
 {
 #ifdef HAVE_DYNAMIC_PLUGINS
     module_t * p_module;
@@ -297,8 +279,7 @@ void module_ManageBank( module_bank_t * p_bank )
  *****************************************************************************
  * This function returns the module that best fits the asked capabilities.
  *****************************************************************************/
-module_t * module_Need( module_bank_t *p_bank,
-                        int i_capabilities, void *p_data )
+module_t * module_Need( int i_capabilities, void *p_data )
 {
     module_t * p_module;
     module_t * p_bestmodule = NULL;
@@ -379,7 +360,7 @@ module_t * module_Need( module_bank_t *p_bank,
  * This function must be called by the thread that called module_Need, to
  * decrease the reference count and allow for hiding of modules.
  *****************************************************************************/
-void module_Unneed( module_bank_t * p_bank, module_t * p_module )
+void module_Unneed( module_t * p_module )
 {
     /* We take the global lock */
     vlc_mutex_lock( &p_bank->lock );
@@ -408,7 +389,7 @@ void module_Unneed( module_bank_t * p_bank, module_t * p_module )
  * for its information data. The module can then be handled by module_Need,
  * module_Unneed and HideModule. It can be removed by DeleteModule.
  *****************************************************************************/
-static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
+static int AllocatePluginModule( char * psz_filename )
 {
     module_t * p_module, * p_othermodule;
     module_handle_t handle;
@@ -527,8 +508,7 @@ static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
  * for its information data. The module can then be handled by module_Need,
  * module_Unneed and HideModule. It can be removed by DeleteModule.
  *****************************************************************************/
-static int AllocateBuiltinModule( module_bank_t * p_bank,
-                                  int ( *pf_init ) ( module_t * ),
+static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ),
                                   int ( *pf_activate ) ( module_t * ),
                                   int ( *pf_deactivate ) ( module_t * ) )
 {
@@ -627,7 +607,7 @@ static int AllocateBuiltinModule( module_bank_t * p_bank,
  *****************************************************************************
  * This function can only be called if i_usage <= 0.
  *****************************************************************************/
-static int DeleteModule( module_bank_t * p_bank, module_t * p_module )
+static int DeleteModule( module_t * p_module )
 {
     /* If the module is not in use but is still in memory, we first have
      * to hide it and remove it from memory before we can free the
index 0eb9bf0c2a83750fb84058001985ab64bacd877a..fcae25b41492a2738a6bd159ff0039f8287d7269 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: video_output.c,v 1.121 2001/04/27 19:29:11 massiot Exp $
+ * $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -109,8 +109,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
     }
 
     /* Choose the best module */
-    p_vout->p_module = module_Need( p_main->p_bank,
-                                    MODULE_CAPABILITY_VOUT, NULL );
+    p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, NULL );
 
     if( p_vout->p_module == NULL )
     {
@@ -197,7 +196,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
      * own error messages */
     if( p_vout->pf_create( p_vout ) )
     {
-        module_Unneed( p_main->p_bank, p_vout->p_module );
+        module_Unneed( p_vout->p_module );
         free( p_vout );
         return( NULL );
     }
@@ -1312,7 +1311,7 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status )
     vlc_mutex_destroy( &p_vout->change_lock );
                 
     /* Release the module */
-    module_Unneed( p_main->p_bank, p_vout->p_module );
+    module_Unneed( p_vout->p_module );
 
     /* Free structure */
     free( p_vout );
index fb650862d9f9d15e3dbcc534869541a9d4652278..caaa1dc2ac3c4f1fb6e69bc225fe0becf05463f8 100644 (file)
@@ -3,7 +3,7 @@
  * These functions set up YUV tables for colorspace conversion
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_yuv.c,v 1.47 2001/03/21 13:42:35 sam Exp $
+ * $Id: video_yuv.c,v 1.48 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -45,8 +45,6 @@
 
 #include "intf_msg.h"
 
-#include "main.h"
-
 /*****************************************************************************
  * vout_InitYUV: allocate and initialize translation tables
  *****************************************************************************
@@ -56,8 +54,7 @@
 int vout_InitYUV( vout_thread_t *p_vout )
 {
     /* Choose the best module */
-    p_vout->yuv.p_module = module_Need( p_main->p_bank,
-                                        MODULE_CAPABILITY_YUV, NULL );
+    p_vout->yuv.p_module = module_Need( MODULE_CAPABILITY_YUV, NULL );
 
     if( p_vout->yuv.p_module == NULL )
     {
@@ -94,6 +91,6 @@ int vout_ResetYUV( vout_thread_t *p_vout )
 void vout_EndYUV( vout_thread_t *p_vout )
 {
     p_vout->yuv.pf_end( p_vout );
-    module_Unneed( p_main->p_bank, p_vout->yuv.p_module );
+    module_Unneed( p_vout->yuv.p_module );
 }
 
index d9ba15f423aa94fee035ed24aee24dbce21d0e05..0ffaa98f48b469481279310911d8173d3fb1a873 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.c,v 1.81 2001/04/29 14:52:42 stef Exp $
+ * $Id: video_parser.c,v 1.82 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
 #include "../video_decoder/video_parser.h"
 #include "../video_decoder/video_fifo.h"
 
-#include "main.h"
-
 /*
  * Local prototypes
  */
-static int      InitThread          ( vpar_thread_t *p_vpar );
-static void     RunThread           ( vpar_thread_t *p_vpar );
-static void     ErrorThread         ( vpar_thread_t *p_vpar );
-static void     EndThread           ( vpar_thread_t *p_vpar );
-static void     BitstreamCallback   ( bit_stream_t *p_bit_stream,
-                                      boolean_t b_new_pes );
+static int      InitThread          ( vpar_thread_t * );
+static void     RunThread           ( vpar_thread_t * );
+static void     ErrorThread         ( vpar_thread_t * );
+static void     EndThread           ( vpar_thread_t * );
+static void     BitstreamCallback   ( bit_stream_t *, boolean_t );
 
 /*****************************************************************************
  * vpar_CreateThread: create a generic parser thread
@@ -103,8 +100,7 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
     /*
      * Choose the best motion compensation module
      */
-    p_vpar->p_motion_module = module_Need( p_main->p_bank,
-                                           MODULE_CAPABILITY_MOTION, NULL );
+    p_vpar->p_motion_module = module_Need( MODULE_CAPABILITY_MOTION, NULL );
 
     if( p_vpar->p_motion_module == NULL )
     {
@@ -113,69 +109,68 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
         return( 0 );
     }
 
-#define m ( p_vpar->pppf_motion )
-#define s ( p_vpar->ppf_motion_skipped )
-#define f ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
-    m[0][0][0] = m[0][0][1] = m[0][0][2] = m[0][0][3] = NULL;
-    m[0][1][0] = m[0][1][1] = m[0][1][2] = m[0][1][3] = NULL;
-    m[1][0][0] = NULL;
-    m[1][1][0] = NULL;
-    m[2][0][0] = NULL;
-    m[2][1][0] = NULL;
-    m[3][0][0] = NULL;
-    m[3][1][0] = NULL;
-
-    m[1][0][1] = f.pf_field_field_420;
-    m[1][1][1] = f.pf_frame_field_420;
-    m[2][0][1] = f.pf_field_field_422;
-    m[2][1][1] = f.pf_frame_field_422;
-    m[3][0][1] = f.pf_field_field_444;
-    m[3][1][1] = f.pf_frame_field_444;
-
-    m[1][0][2] = f.pf_field_16x8_420;
-    m[1][1][2] = f.pf_frame_frame_420;
-    m[2][0][2] = f.pf_field_16x8_422;
-    m[2][1][2] = f.pf_frame_frame_422;
-    m[3][0][2] = f.pf_field_16x8_444;
-    m[3][1][2] = f.pf_frame_frame_444;
-
-    m[1][0][3] = f.pf_field_dmv_420;
-    m[1][1][3] = f.pf_frame_dmv_420;
-    m[2][0][3] = f.pf_field_dmv_422;
-    m[2][1][3] = f.pf_frame_dmv_422;
-    m[3][0][3] = f.pf_field_dmv_444;
-    m[3][1][3] = f.pf_frame_dmv_444;
-
-    s[0][0] = s[0][1] = s[0][2] = s[0][3] = NULL;
-    s[1][0] = NULL;
-    s[2][0] = NULL;
-    s[3][0] = NULL;
-
-    s[1][1] = f.pf_field_field_420;
-    s[2][1] = f.pf_field_field_422;
-    s[3][1] = f.pf_field_field_444;
-
-    s[1][2] = f.pf_field_field_420;
-    s[2][2] = f.pf_field_field_422;
-    s[3][2] = f.pf_field_field_444;
-
-    s[1][3] = f.pf_frame_frame_420;
-    s[2][3] = f.pf_frame_frame_422;
-    s[3][3] = f.pf_frame_frame_444;
-#undef f
-#undef s
-#undef m
+#define M ( p_vpar->pppf_motion )
+#define S ( p_vpar->ppf_motion_skipped )
+#define F ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
+    M[0][0][0] = M[0][0][1] = M[0][0][2] = M[0][0][3] = NULL;
+    M[0][1][0] = M[0][1][1] = M[0][1][2] = M[0][1][3] = NULL;
+    M[1][0][0] = NULL;
+    M[1][1][0] = NULL;
+    M[2][0][0] = NULL;
+    M[2][1][0] = NULL;
+    M[3][0][0] = NULL;
+    M[3][1][0] = NULL;
+
+    M[1][0][1] = F.pf_field_field_420;
+    M[1][1][1] = F.pf_frame_field_420;
+    M[2][0][1] = F.pf_field_field_422;
+    M[2][1][1] = F.pf_frame_field_422;
+    M[3][0][1] = F.pf_field_field_444;
+    M[3][1][1] = F.pf_frame_field_444;
+
+    M[1][0][2] = F.pf_field_16x8_420;
+    M[1][1][2] = F.pf_frame_frame_420;
+    M[2][0][2] = F.pf_field_16x8_422;
+    M[2][1][2] = F.pf_frame_frame_422;
+    M[3][0][2] = F.pf_field_16x8_444;
+    M[3][1][2] = F.pf_frame_frame_444;
+
+    M[1][0][3] = F.pf_field_dmv_420;
+    M[1][1][3] = F.pf_frame_dmv_420;
+    M[2][0][3] = F.pf_field_dmv_422;
+    M[2][1][3] = F.pf_frame_dmv_422;
+    M[3][0][3] = F.pf_field_dmv_444;
+    M[3][1][3] = F.pf_frame_dmv_444;
+
+    S[0][0] = S[0][1] = S[0][2] = S[0][3] = NULL;
+    S[1][0] = NULL;
+    S[2][0] = NULL;
+    S[3][0] = NULL;
+
+    S[1][1] = F.pf_field_field_420;
+    S[2][1] = F.pf_field_field_422;
+    S[3][1] = F.pf_field_field_444;
+
+    S[1][2] = F.pf_field_field_420;
+    S[2][2] = F.pf_field_field_422;
+    S[3][2] = F.pf_field_field_444;
+
+    S[1][3] = F.pf_frame_frame_420;
+    S[2][3] = F.pf_frame_frame_422;
+    S[3][3] = F.pf_frame_frame_444;
+#undef F
+#undef S
+#undef M
 
      /*
       * Choose the best IDCT module
       */
-    p_vpar->p_idct_module = module_Need( p_main->p_bank,
-                                         MODULE_CAPABILITY_IDCT, NULL );
+    p_vpar->p_idct_module = module_Need( MODULE_CAPABILITY_IDCT, NULL );
 
     if( p_vpar->p_idct_module == NULL )
     {
         intf_ErrMsg( "vpar error: no suitable IDCT module" );
-        module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
+        module_Unneed( p_vpar->p_motion_module );
         free( p_vpar );
         return( 0 );
     }
@@ -192,8 +187,8 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
                             (vlc_thread_func_t)RunThread, (void *)p_vpar ) )
     {
         intf_ErrMsg("vpar error: can't spawn video parser thread");
-        module_Unneed( p_main->p_bank, p_vpar->p_idct_module );
-        module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
+        module_Unneed( p_vpar->p_idct_module );
+        module_Unneed( p_vpar->p_motion_module );
         free( p_vpar );
         return( 0 );
     }
@@ -506,8 +501,8 @@ static void EndThread( vpar_thread_t *p_vpar )
     
     vlc_mutex_destroy( &(p_vpar->synchro.fifo_lock) );
     
-    module_Unneed( p_main->p_bank, p_vpar->p_idct_module );
-    module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
+    module_Unneed( p_vpar->p_idct_module );
+    module_Unneed( p_vpar->p_motion_module );
 
     free( p_vpar );
 
index 74b2e8dfb708bdc436772938b690a126c48a1d6b..779cfa9eaaf48b13be02ffd6c5012345900585be 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.82 2001/04/28 03:36:26 sam Exp $
+ * $Id: vpar_headers.c,v 1.83 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -53,6 +53,8 @@
 #include "../video_decoder/video_parser.h"
 #include "../video_decoder/video_fifo.h"
 
+#include "main.h" /* XXX REMOVE THIS */
+
 /*
  * Local prototypes
  */
@@ -448,6 +450,13 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
 
     /* Extension and User data */
     ExtensionAndUserData( p_vpar );
+
+    /* XXX: The vout request and fifo opening will eventually be here */
+    if( p_main->p_vout == NULL )
+    {
+       intf_Msg( "vpar: no vout present, spawning one" );
+        p_main->p_vout = p_vpar->p_vout = vout_CreateThread( NULL );
+    }
 }
 
 /*****************************************************************************
index 58de4ded9c0a7327e751cebb3d909f236804d499..79848c2d0f0191322ad01759c20796b91b2319a6 100644 (file)
--- a/vlc.spec
+++ b/vlc.spec
@@ -1,16 +1,21 @@
 Name: vlc
 Version: 0.2.73
-Release: 1
+Release: 2
 Copyright: GPL
 Url: http://www.videolan.org/
 Group: X11/Applications/Graphics
 Source0: http://www.videolan.org/packages/0.2.73/vlc-0.2.73.tar.gz
+Prefix: /usr
 Packager: Samuel Hocevar <sam@zoy.org>
 
 Buildroot: /tmp/vlc-build
 Summary: VideoLAN Client.
+Summary(fr): Client VideoLAN.
 
 %changelog
+* Mon Apr 30 2001 Arnaud Gomes-do-Vale <arnaud@glou.org>
+Added relocation support and compile fixes for Red Hat 7.x.
+
 * Sat Apr 28 2001 Henri Fallon <henri@videolan.org>
 New upstream release (0.2.73)
 
@@ -42,21 +47,37 @@ a free network-aware MPEG and DVD player
  The VideoLAN Client allows to play MPEG2 Transport Streams from the
  network or from a file, as well as direct DVD playback.
 
+%description -l fr
+Un lecteur MPEG et DVD utilisable en réseau.
+VideoLAN est un lecteur MPEG1/2. Le client VideoLAN permet la lecture de
+flux MPEG2 depuis le réseau ou depuis un fichier, en plus de la lecture
+directe des DVD.
+
 %prep
 %setup 
 
 %build
-./configure --prefix=/usr --with-sdl --enable-esd --enable-gnome --enable-qt
-make
+if [ -x %{prefix}/bin/kgcc ] ;
+then
+  CC=%{prefix}/bin/kgcc ./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
+else
+  ./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
+fi
+if [ -x %{prefix}/bin/kgcc ] ;
+then
+  CC=%{prefix}/bin/kgcc make
+else
+  make
+fi
 %install
-mkdir -p $RPM_BUILD_ROOT/usr/lib
-mkdir -p $RPM_BUILD_ROOT/usr/bin
-make install prefix=$RPM_BUILD_ROOT/usr
+mkdir -p $RPM_BUILD_ROOT%{prefix}/lib
+mkdir -p $RPM_BUILD_ROOT%{prefix}/bin
+make install prefix=$RPM_BUILD_ROOT%{prefix}
 
 %files
-%attr(-, root, root) /usr/bin/vlc
-%attr(-, root, root) /usr/share/videolan
-%attr(-, root, root) /usr/lib/videolan
+%attr(-, root, root) %{prefix}/bin/vlc
+%attr(-, root, root) %{prefix}/share/videolan
+%attr(-, root, root) %{prefix}/lib/videolan
 %attr(-, root, root) %doc ChangeLog AUTHORS COPYING INSTALL README TODO doc
 %clean
 rm -rf $RPM_BUILD_ROOT