From 4c6811495b74a893959cdb6bf633ec9a92f792a2 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 24 Jan 2002 13:32:53 +0000 Subject: [PATCH] * ./src/misc/modules_plugin.h: fixed a missing function initialization which made decoder plugins segfault in GetChunk calls. * ./configure.in: proper soundcard.h check from Yves Duret. --- AUTHORS | 4 ++ configure | 145 ++++++++++++++++++++++++++------------ configure.in | 13 ++-- include/defs.h.in | 3 + src/misc/modules.c | 35 +++++---- src/misc/modules_plugin.h | 3 +- 6 files changed, 137 insertions(+), 66 deletions(-) diff --git a/AUTHORS b/AUTHORS index f78dab6803..2400045e41 100644 --- a/AUTHORS +++ b/AUTHORS @@ -148,6 +148,10 @@ E: aholtzma@ess.engr.uvic.ca D: AC3 decoder D: MPEG video decoder +N: Hans-Peter Jansen +E: hpj@urpla.net +D: patch for module options handling + N: Eugenio Jarosiewicz E: ej0@cise.ufl.edu C: ej diff --git a/configure b/configure index cadb4370bd..9aec3b9577 100755 --- a/configure +++ b/configure @@ -6563,10 +6563,48 @@ fi if test x$enable_dsp != xno && (test $SYS != mingw32 || test x$enable_dsp = xyes) then - if test -c /dev/dsp - then + 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:6571: 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:6581: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + fi # Check whether --enable-esd or --disable-esd was given. @@ -6577,7 +6615,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:6581: checking for $ac_word" >&5 +echo "configure:6619: 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 @@ -6628,7 +6666,7 @@ if test "${enable_arts+set}" = set; then # Extract the first word of "artsc-config", so it can be a program name with args. set dummy artsc-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6632: checking for $ac_word" >&5 +echo "configure:6670: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6686,17 +6724,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6690: checking for $ac_hdr" >&5 +echo "configure:6728: 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:6700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6738: \"$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* @@ -6741,17 +6779,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6745: checking for $ac_hdr" >&5 +echo "configure:6783: 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:6755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6793: \"$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* @@ -6839,7 +6877,7 @@ fi # Extract the first word of "sdl12-config", so it can be a program name with args. set dummy sdl12-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6843: checking for $ac_word" >&5 +echo "configure:6881: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6879,7 +6917,7 @@ fi # Extract the first word of "sdl11-config", so it can be a program name with args. set dummy sdl11-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6883: checking for $ac_word" >&5 +echo "configure:6921: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6920,7 +6958,7 @@ fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6924: checking for $ac_word" >&5 +echo "configure:6962: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6966,17 +7004,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6970: checking for $ac_hdr" >&5 +echo "configure:7008: 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:6980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7018: \"$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* @@ -7046,17 +7084,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7050: checking for $ac_hdr" >&5 +echo "configure:7088: 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:7060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7098: \"$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* @@ -7085,7 +7123,7 @@ done else echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6 -echo "configure:7089: checking for directX headers in ${withval}" >&5 +echo "configure:7127: checking for directX headers in ${withval}" >&5 if test -f ${withval}/include/directx.h then PLUGINS="${PLUGINS} directx" @@ -7182,7 +7220,7 @@ if test "${enable_gnome+set}" = set; then # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7186: checking for $ac_word" >&5 +echo "configure:7224: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7227,17 +7265,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7231: checking for $ac_hdr" >&5 +echo "configure:7269: 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:7241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7279: \"$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* @@ -7297,7 +7335,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7301: checking for $ac_word" >&5 +echo "configure:7339: 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 @@ -7347,17 +7385,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7351: checking for $ac_hdr" >&5 +echo "configure:7389: 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:7361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7399: \"$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* @@ -7414,17 +7452,17 @@ if test x$enable_x11 != xno && do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7418: checking for $ac_hdr" >&5 +echo "configure:7456: 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:7428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7466: \"$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* @@ -7449,12 +7487,29 @@ EOF LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext" CFLAGS_X11="${CFLAGS_X11} -I$x_includes" - CPPFLAGS=$saved_CPPFLAGS else echo "$ac_t""no" 1>&6 fi done + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "DPMSInfo" >/dev/null 2>&1; then + rm -rf conftest* + + cat >> confdefs.h <<\EOF +#define DPMSINFO_IN_DPMS_H 1 +EOF + + +fi +rm -f conftest* + + CPPFLAGS=$saved_CPPFLAGS fi # Check whether --enable-xvideo or --disable-xvideo was given. @@ -7477,17 +7532,17 @@ if test x$enable_xvideo != xno && do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7481: checking for $ac_hdr" >&5 +echo "configure:7536: 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:7491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7546: \"$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* @@ -7511,7 +7566,7 @@ EOF saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext" echo $ac_n "checking for XvSetPortAttribute in -lXv_pic""... $ac_c" 1>&6 -echo "configure:7515: checking for XvSetPortAttribute in -lXv_pic" >&5 +echo "configure:7570: checking for XvSetPortAttribute in -lXv_pic" >&5 ac_lib_var=`echo Xv_pic'_'XvSetPortAttribute | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7519,7 +7574,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXv_pic $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7589: \"$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 @@ -7574,17 +7629,17 @@ if test "${enable_alsa+set}" = set; then then ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6 -echo "configure:7578: checking for alsa/asoundlib.h" >&5 +echo "configure:7633: checking for alsa/asoundlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7643: \"$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* @@ -7601,7 +7656,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:7605: checking for main in -lasound" >&5 +echo "configure:7660: 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 @@ -7609,14 +7664,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:7675: \"$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 diff --git a/configure.in b/configure.in index c32be2d967..a2c94cc83c 100644 --- a/configure.in +++ b/configure.in @@ -943,10 +943,9 @@ AC_ARG_ENABLE(dsp, if test x$enable_dsp != xno && (test $SYS != mingw32 || test x$enable_dsp = xyes) then - if test -c /dev/dsp - then + AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, [ PLUGINS="${PLUGINS} dsp" - fi + ]) fi dnl @@ -1299,8 +1298,12 @@ if test x$enable_x11 != xno && PLUGINS="${PLUGINS} x11" LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext" CFLAGS_X11="${CFLAGS_X11} -I$x_includes" - ] - CPPFLAGS=$saved_CPPFLAGS) + ]) + AC_EGREP_HEADER(DPMSInfo,X11/extensions/dmps.h,[ + AC_DEFINE(DPMSINFO_IN_DPMS_H, 1, + Define if defines DPMSInfo.) + ]) + CPPFLAGS=$saved_CPPFLAGS fi dnl diff --git a/include/defs.h.in b/include/defs.h.in index 9919f381e1..0244a9e0a0 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -404,3 +404,6 @@ /* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */ #undef SDL_INCLUDE_FILE +/* Define if defines DPMSInfo. */ +#undef DPMSINFO_IN_DPMS_H + diff --git a/src/misc/modules.c b/src/misc/modules.c index 782e18940e..508dafa214 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,10 +2,11 @@ * modules.c : Built-in and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.49 2002/01/21 00:52:07 sam Exp $ + * $Id: modules.c,v 1.50 2002/01/24 13:32:53 sam Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge + * Hans-Peter Jansen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -274,23 +275,23 @@ module_t * module_Need( int i_capability, char *psz_name, probedata_t *p_data ) if( psz_name != NULL && *psz_name ) { -#define MAX_PLUGIN_NAME 128 /* A module name was requested. Use the first matching one. */ - char psz_realname[ MAX_PLUGIN_NAME + 1 ]; + char *psz_realname = NULL; int i_index; boolean_t b_ok = 0; - for( i_index = 0; - i_index < MAX_PLUGIN_NAME - && psz_name[ i_index ] - && psz_name[ i_index ] != ':'; - i_index++ ) + psz_realname = strdup( psz_name ); + if( psz_realname ) { - psz_realname[ i_index ] = psz_name[ i_index ]; + char *p; + p = strchr( psz_realname, ':' ); + if( p ) + { + *p = '\0'; + } + psz_name = psz_realname; } - - psz_realname[ i_index ] = '\0'; - + for( p_module = p_module_bank->first; p_module != NULL; p_module = p_module->next ) @@ -313,8 +314,7 @@ module_t * module_Need( int i_capability, char *psz_name, probedata_t *p_data ) !b_ok && p_module->pp_shortcuts[i_index]; i_index++ ) { - b_ok = !strcmp( psz_realname, - p_module->pp_shortcuts[i_index] ); + b_ok = !strcmp( psz_name, p_module->pp_shortcuts[i_index] ); } if( b_ok ) @@ -331,7 +331,12 @@ module_t * module_Need( int i_capability, char *psz_name, probedata_t *p_data ) else { intf_ErrMsg( "module error: requested %s module `%s' not found", - GetCapabilityName( i_capability ), psz_realname ); + GetCapabilityName( i_capability ), psz_name ); + } + + if( psz_realname ) + { + free( psz_realname ); } } else diff --git a/src/misc/modules_plugin.h b/src/misc/modules_plugin.h index b22153a508..f31dcaa333 100644 --- a/src/misc/modules_plugin.h +++ b/src/misc/modules_plugin.h @@ -2,7 +2,7 @@ * modules_plugin.h : Plugin management functions used by the core application. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_plugin.h,v 1.6 2002/01/21 23:57:46 massiot Exp $ + * $Id: modules_plugin.h,v 1.7 2002/01/24 13:32:53 sam Exp $ * * Authors: Samuel Hocevar * @@ -198,6 +198,7 @@ module_error( void ) (p_symbols)->input_DelArea = input_DelArea; \ (p_symbols)->InitBitstream = InitBitstream; \ (p_symbols)->NextDataPacket = NextDataPacket; \ + (p_symbols)->BitstreamNextDataPacket = BitstreamNextDataPacket; \ (p_symbols)->DecoderError = DecoderError; \ (p_symbols)->input_InitStream = input_InitStream; \ (p_symbols)->input_EndStream = input_EndStream; \ -- 2.39.2