diff --git a/AUTHORS b/AUTHORS index f60ecb3c59aa..61232f669bc0 100644 --- 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 diff --git a/ChangeLog b/ChangeLog index b90e177642b9..a0ae62eada7a 100644 --- 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 + . + * DVD title change no longer restarts the input. * BeOS crash fix by Wade Majors . * 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 ce399befc03d..7faafafbbd60 100644 --- 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 diff --git a/Makefile b/Makefile index 4f494d813f07..e725cfd42b38 100644 --- 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) $@ diff --git a/Makefile.opts.in b/Makefile.opts.in index 98d9be81297a..eb4d17dadde8 100644 --- a/Makefile.opts.in +++ b/Makefile.opts.in @@ -45,6 +45,7 @@ CC = @CC@ CFLAGS = @CFLAGS@ SHELL = @SHELL@ RANLIB = @RANLIB@ +MOC = @MOC@ # # Installation environment diff --git a/configure b/configure index e07896ce5c37..cfc4a763e744 100755 --- 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 < +/* 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 <&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 <&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 <&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 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 <&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 <&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 < #include @@ -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 <&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 <&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 <&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 <&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 <&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 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 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 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 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 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 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 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 @@ -2737,7 +2792,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < 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 < 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 <&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 < 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 < 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 <&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 < #include @@ -2946,7 +3001,7 @@ else #include 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 @@ -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 @@ -3002,7 +3057,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #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 < #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 < #include @@ -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 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 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 @@ -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 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 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 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 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 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 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 <&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." diff --git a/configure.in b/configure.in index 2b456668dfac..33fe2a50150e 100644 --- a/configure.in +++ b/configure.in @@ -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." diff --git a/doc/vlc.1 b/doc/vlc.1 index 19d16baa69ab..494508125fd7 100644 --- 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= audio method vlc_dsp= dsp device path vlc_stereo={1|0} stereo or mono output + vlc_spdif={1|0} AC3 pass-through mode vlc_audio_rate= output rate .TP .B Video parameters: diff --git a/include/audio_output.h b/include/audio_output.h index 0576f2415a95..b7301c1007d9 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -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 * @@ -21,27 +21,6 @@ * 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 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 ); diff --git a/include/config.h.in b/include/config.h.in index 4025bd6ea0f0..f61f7bd64865 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -238,6 +238,10 @@ #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 diff --git a/include/defs.h.in b/include/defs.h.in index 9caa9fed28c5..32fbf9cf7c7d 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -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 diff --git a/include/input_ext-dec.h b/include/input_ext-dec.h index d79a7422636d..688669190b93 100644 --- a/include/input_ext-dec.h +++ b/include/input_ext-dec.h @@ -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 * Michel Kaempf @@ -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; diff --git a/include/input_ext-intf.h b/include/input_ext-intf.h index 55014885c081..d426c265ead8 100644 --- a/include/input_ext-intf.h +++ b/include/input_ext-intf.h @@ -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 * @@ -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 diff --git a/include/main.h b/include/main.h index d5965d0937e4..bd868c2b9855 100644 --- a/include/main.h +++ b/include/main.h @@ -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 * @@ -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 */ diff --git a/include/modules.h b/include/modules.h index 728cc32d4cdf..3752aad30dea 100644 --- a/include/modules.h +++ b/include/modules.h @@ -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 * @@ -25,6 +25,25 @@ #include /* 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 ); diff --git a/include/modules_builtin.h.in b/include/modules_builtin.h.in index ac1cbdcaee61..ccbfa125f401 100644 --- a/include/modules_builtin.h.in +++ b/include/modules_builtin.h.in @@ -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 */ diff --git a/include/video_output.h b/include/video_output.h index c654fdbe7440..3923a275ee8d 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -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 * @@ -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 ); diff --git a/plugins/alsa/Makefile b/plugins/alsa/Makefile index b2336abe23f0..34bf64c22f29 100644 --- a/plugins/alsa/Makefile +++ b/plugins/alsa/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/alsa.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/beos/Makefile b/plugins/beos/Makefile index e185457bf5f4..654c8d5cca4f 100644 --- a/plugins/beos/Makefile +++ b/plugins/beos/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/beos.a: $(BUILTIN_CPP) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/beos/intf_beos.cpp b/plugins/beos/intf_beos.cpp index bee872e340d7..554fb903a9cd 100644 --- a/plugins/beos/intf_beos.cpp +++ b/plugins/beos/intf_beos.cpp @@ -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 * Samuel Hocevar @@ -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; diff --git a/plugins/darwin/Makefile b/plugins/darwin/Makefile index 5c13ba2a73b8..0766e1fea58f 100644 --- a/plugins/darwin/Makefile +++ b/plugins/darwin/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/darwin.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/dsp/Makefile b/plugins/dsp/Makefile index a5218f76f60f..de25fe21da24 100644 --- a/plugins/dsp/Makefile +++ b/plugins/dsp/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/dsp.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/dummy/Makefile b/plugins/dummy/Makefile index b99127d1cb9c..5ee16de1bed1 100644 --- a/plugins/dummy/Makefile +++ b/plugins/dummy/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/dummy.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/dvd/Makefile b/plugins/dvd/Makefile index b16686d391f4..e6653cbe90f0 100644 --- a/plugins/dvd/Makefile +++ b/plugins/dvd/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/dvd.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/esd/Makefile b/plugins/esd/Makefile index 35861f0d683a..e3e5a4cd0c1a 100644 --- a/plugins/esd/Makefile +++ b/plugins/esd/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/esd.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/fb/Makefile b/plugins/fb/Makefile index d10037f5fd82..bc1ecfb4e693 100644 --- a/plugins/fb/Makefile +++ b/plugins/fb/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/fb.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/ggi/Makefile b/plugins/ggi/Makefile index 40f12b442cba..ccd4df6f89be 100644 --- a/plugins/ggi/Makefile +++ b/plugins/ggi/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/ggi.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/glide/Makefile b/plugins/glide/Makefile index ed4a5e4c6eb6..11033e1ded4b 100644 --- a/plugins/glide/Makefile +++ b/plugins/glide/Makefile @@ -35,4 +35,5 @@ $(BUILTIN_GLIDE): BUILTIN_%.o: %.c ../../lib/glide.a: $(BUILTIN_GLIDE) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/gnome/Makefile b/plugins/gnome/Makefile index 39789da6eab6..5665090ee8f6 100644 --- a/plugins/gnome/Makefile +++ b/plugins/gnome/Makefile @@ -35,4 +35,5 @@ $(BUILTIN_GNOME): BUILTIN_%.o: %.c ../../lib/gnome.a: $(BUILTIN_GNOME) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/gnome/gnome_callbacks.c b/plugins/gnome/gnome_callbacks.c index 64d89d4c05ff..e3f6a635bb0e 100644 --- a/plugins/gnome/gnome_callbacks.c +++ b/plugins/gnome/gnome_callbacks.c @@ -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 * Stéphane Borel @@ -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; diff --git a/plugins/gnome/intf_gnome.c b/plugins/gnome/intf_gnome.c index 6c4a67b9ee70..14a6afbd8324 100644 --- a/plugins/gnome/intf_gnome.c +++ b/plugins/gnome/intf_gnome.c @@ -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 * Stéphane Borel @@ -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 = diff --git a/plugins/gtk/Makefile b/plugins/gtk/Makefile index d1fb0abe1b4a..8cb6b849226d 100644 --- a/plugins/gtk/Makefile +++ b/plugins/gtk/Makefile @@ -33,4 +33,5 @@ include ../../Makefile.modules ../../lib/gtk.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/idct/Makefile b/plugins/idct/Makefile index c4f091b94e49..25cd61897e17 100644 --- a/plugins/idct/Makefile +++ b/plugins/idct/Makefile @@ -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) $@ diff --git a/plugins/macosx/Makefile b/plugins/macosx/Makefile index 2f048f6c456d..12af4d04027b 100644 --- a/plugins/macosx/Makefile +++ b/plugins/macosx/Makefile @@ -35,4 +35,5 @@ $(BUILTIN_MACOSX): BUILTIN_%.o: %.c ../../lib/macosx.a: $(BUILTIN_MACOSX) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/macosx/intf_macosx.c b/plugins/macosx/intf_macosx.c index 2e3732c53182..60aabbbf2242 100644 --- a/plugins/macosx/intf_macosx.c +++ b/plugins/macosx/intf_macosx.c @@ -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; diff --git a/plugins/mga/Makefile b/plugins/mga/Makefile index 3d48c2fb7ce2..bd4c7379d295 100644 --- a/plugins/mga/Makefile +++ b/plugins/mga/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/mga.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/motion/Makefile b/plugins/motion/Makefile index a5b25942b6cf..fb5f26d569c2 100644 --- a/plugins/motion/Makefile +++ b/plugins/motion/Makefile @@ -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) $@ diff --git a/plugins/mpeg/Makefile b/plugins/mpeg/Makefile index 281378158fe9..2e6a21a20e2b 100644 --- a/plugins/mpeg/Makefile +++ b/plugins/mpeg/Makefile @@ -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) $@ diff --git a/plugins/null/Makefile b/plugins/null/Makefile index 19f5c1a0ecff..ebc8b76b5ff7 100644 --- a/plugins/null/Makefile +++ b/plugins/null/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/null.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/qt/Makefile b/plugins/qt/Makefile index 2b51fa6bed9e..9d927f21b0ca 100644 --- a/plugins/qt/Makefile +++ b/plugins/qt/Makefile @@ -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) $@ diff --git a/plugins/sdl/Makefile b/plugins/sdl/Makefile index 183bacb3da58..18cad2fb1f4b 100644 --- a/plugins/sdl/Makefile +++ b/plugins/sdl/Makefile @@ -27,4 +27,5 @@ include ../../Makefile.modules ../../lib/sdl.a: $(BUILTIN_C) ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/text/Makefile b/plugins/text/Makefile index c7603247e95e..2265660a10ce 100644 --- a/plugins/text/Makefile +++ b/plugins/text/Makefile @@ -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) $@ diff --git a/plugins/text/intf_rc.c b/plugins/text/intf_rc.c index b2d76423fe9f..f77afeb2d290 100644 --- a/plugins/text/intf_rc.c +++ b/plugins/text/intf_rc.c @@ -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 diff --git a/plugins/text/rc.c b/plugins/text/rc.c index d43c96c71dd8..8a2b4310c8ef 100644 --- a/plugins/text/rc.c +++ b/plugins/text/rc.c @@ -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 diff --git a/plugins/x11/Makefile b/plugins/x11/Makefile index 30a2426c9514..0c792f1d909a 100644 --- a/plugins/x11/Makefile +++ b/plugins/x11/Makefile @@ -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) $@ diff --git a/plugins/x11/vout_xvideo.c b/plugins/x11/vout_xvideo.c index 7933f4cf5895..6cd0ef1ecd28 100644 --- a/plugins/x11/vout_xvideo.c +++ b/plugins/x11/vout_xvideo.c @@ -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 * Vincent Seguin @@ -207,7 +207,7 @@ static int vout_Probe( probedata_t *p_data ) return( 999 ); } - return( 110 ); + return( 60 ); } /***************************************************************************** diff --git a/plugins/yuv/Makefile b/plugins/yuv/Makefile index 2c92da815a53..229b7deaca23 100644 --- a/plugins/yuv/Makefile +++ b/plugins/yuv/Makefile @@ -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) $@ diff --git a/src/ac3_decoder/ac3_decoder_thread.c b/src/ac3_decoder/ac3_decoder_thread.c index 2b4dc4964500..278942cb0a42 100644 --- a/src/ac3_decoder/ac3_decoder_thread.c +++ b/src/ac3_decoder/ac3_decoder_thread.c @@ -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 * @@ -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; } diff --git a/src/ac3_decoder/ac3_decoder_thread.h b/src/ac3_decoder/ac3_decoder_thread.h index 7501cacc15ae..ae513746264b 100644 --- a/src/ac3_decoder/ac3_decoder_thread.h +++ b/src/ac3_decoder/ac3_decoder_thread.h @@ -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 * @@ -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; diff --git a/src/ac3_spdif/ac3_iec958.c b/src/ac3_spdif/ac3_iec958.c index e5595a08221b..c9994492b7c1 100644 --- a/src/ac3_spdif/ac3_iec958.c +++ b/src/ac3_spdif/ac3_iec958.c @@ -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 * Juha Yrjola @@ -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; } + diff --git a/src/ac3_spdif/ac3_iec958.h b/src/ac3_spdif/ac3_iec958.h index 025507ae670c..502ce3f27c37 100644 --- a/src/ac3_spdif/ac3_iec958.h +++ b/src/ac3_spdif/ac3_iec958.h @@ -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 * Juha Yrjola @@ -23,20 +23,9 @@ * 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 * ); + diff --git a/src/ac3_spdif/ac3_spdif.c b/src/ac3_spdif/ac3_spdif.c index 788e34c33911..907564f19a6c 100644 --- a/src/ac3_spdif/ac3_spdif.c +++ b/src/ac3_spdif/ac3_spdif.c @@ -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 * Juha Yrjola @@ -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 ); diff --git a/src/ac3_spdif/ac3_spdif.h b/src/ac3_spdif/ac3_spdif.h index 908989d27097..9f9fdd278f32 100644 --- a/src/ac3_spdif/ac3_spdif.h +++ b/src/ac3_spdif/ac3_spdif.h @@ -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 * @@ -21,10 +21,15 @@ * 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 diff --git a/src/audio_decoder/audio_decoder.c b/src/audio_decoder/audio_decoder.c index ce728742c4c2..763c3aac8291 100644 --- a/src/audio_decoder/audio_decoder.c +++ b/src/audio_decoder/audio_decoder.c @@ -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 * Michel Lespinasse @@ -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); diff --git a/src/audio_decoder/audio_decoder.h b/src/audio_decoder/audio_decoder.h index 1bb7530fa74e..07e93bb302d4 100644 --- a/src/audio_decoder/audio_decoder.h +++ b/src/audio_decoder/audio_decoder.h @@ -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 * @@ -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; diff --git a/src/audio_output/aout_common.h b/src/audio_output/aout_common.h index f1e537ab2cb9..a46d3cb85e63 100644 --- a/src/audio_output/aout_common.h +++ b/src/audio_output/aout_common.h @@ -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 * @@ -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 *****************************************************************************/ diff --git a/src/audio_output/aout_fifo.c b/src/audio_output/aout_ext-dec.c similarity index 59% rename from src/audio_output/aout_fifo.c rename to src/audio_output/aout_ext-dec.c index 712a8461fc66..337c6a5863e7 100644 --- a/src/audio_output/aout_fifo.c +++ b/src/audio_output/aout_ext-dec.c @@ -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 * @@ -39,115 +39,137 @@ #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 } /***************************************************************************** diff --git a/src/audio_output/aout_s16.c b/src/audio_output/aout_s16.c index 26387d6e61c9..a0a41a230d74 100644 --- a/src/audio_output/aout_s16.c +++ b/src/audio_output/aout_s16.c @@ -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; } diff --git a/src/audio_output/aout_u8.c b/src/audio_output/aout_u8.c index e25cf1768177..d23de0d2f2c3 100644 --- a/src/audio_output/aout_u8.c +++ b/src/audio_output/aout_u8.c @@ -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 * @@ -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 ); diff --git a/src/audio_output/audio_output.c b/src/audio_output/audio_output.c index 79892cd664cc..6ad459b7d066 100644 --- a/src/audio_output/audio_output.c +++ b/src/audio_output/audio_output.c @@ -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 * @@ -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 ); diff --git a/src/input/input.c b/src/input/input.c index 1c29372b6505..43c0b9fbc5bc 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -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 * @@ -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 ); } diff --git a/src/input/input_programs.c b/src/input/input_programs.c index ca1996bbd608..12c6efcbdf96 100644 --- a/src/input/input_programs.c +++ b/src/input/input_programs.c @@ -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 * @@ -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 ); diff --git a/src/interface/interface.c b/src/interface/interface.c index 402eede8adf4..b627e8c2a367 100644 --- a/src/interface/interface.c +++ b/src/interface/interface.c @@ -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 * @@ -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) ) diff --git a/src/interface/main.c b/src/interface/main.c index 6b04662b747b..bfdc998c994e 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -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 * Samuel Hocevar @@ -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 \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 \tvideo output method" @@ -809,6 +780,7 @@ static void Usage( int i_fashion ) "\n " AOUT_METHOD_VAR "= \taudio method" "\n " AOUT_DSP_VAR "= \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 "= \toutput rate" ); /* Video parameters */ diff --git a/src/lpcm_decoder/lpcm_decoder_thread.c b/src/lpcm_decoder/lpcm_decoder_thread.c index 06498ef061f2..9a3c3d260c98 100644 --- a/src/lpcm_decoder/lpcm_decoder_thread.c +++ b/src/lpcm_decoder/lpcm_decoder_thread.c @@ -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 * @@ -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; } diff --git a/src/lpcm_decoder/lpcm_decoder_thread.h b/src/lpcm_decoder/lpcm_decoder_thread.h index 22871319b30e..30b95b449a58 100644 --- a/src/lpcm_decoder/lpcm_decoder_thread.h +++ b/src/lpcm_decoder/lpcm_decoder_thread.h @@ -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 * @@ -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 ); + diff --git a/src/misc/modules.c b/src/misc/modules.c index 50b9dd8667f6..7ae18bc477f1 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -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 * Ethan C. Baldridge @@ -60,19 +60,18 @@ #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 diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 0eb9bf0c2a83..fcae25b41492 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -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 * @@ -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 ); diff --git a/src/video_output/video_yuv.c b/src/video_output/video_yuv.c index fb650862d9f9..caaa1dc2ac3c 100644 --- a/src/video_output/video_yuv.c +++ b/src/video_output/video_yuv.c @@ -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 * @@ -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 ); } diff --git a/src/video_parser/video_parser.c b/src/video_parser/video_parser.c index d9ba15f423aa..0ffaa98f48b4 100644 --- a/src/video_parser/video_parser.c +++ b/src/video_parser/video_parser.c @@ -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 * Samuel Hocevar @@ -60,17 +60,14 @@ #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 ); diff --git a/src/video_parser/vpar_headers.c b/src/video_parser/vpar_headers.c index 74b2e8dfb708..779cfa9eaaf4 100644 --- a/src/video_parser/vpar_headers.c +++ b/src/video_parser/vpar_headers.c @@ -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 * Stéphane Borel @@ -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 ); + } } /***************************************************************************** diff --git a/vlc.spec b/vlc.spec index 58de4ded9c0a..79848c2d0f01 100644 --- 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 Buildroot: /tmp/vlc-build Summary: VideoLAN Client. +Summary(fr): Client VideoLAN. %changelog +* Mon Apr 30 2001 Arnaud Gomes-do-Vale +Added relocation support and compile fixes for Red Hat 7.x. + * Sat Apr 28 2001 Henri Fallon 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