diff -ru xmms-mad-0.5.1/config/ltmain.sh xmms-mad-0.5.1-patched/config/ltmain.sh --- xmms-mad-0.5.1/config/ltmain.sh 2002-10-07 07:58:02.000000000 +0200 +++ xmms-mad-0.5.1-patched/config/ltmain.sh 2003-07-01 01:35:15.000000000 +0200 @@ -2977,6 +2977,11 @@ done deplibs="$tmp_deplibs" done + if test "x$verstring" = "x0.0"; then + tmp_verstring= + else + tmp_verstring="$verstring" + fi eval cmds=\"$archive_cmds\" deplibs="$save_deplibs" fi diff -ru xmms-mad-0.5.1/configure xmms-mad-0.5.1-patched/configure --- xmms-mad-0.5.1/configure 2002-10-21 02:10:41.000000000 +0200 +++ xmms-mad-0.5.1-patched/configure 2003-07-01 01:35:21.000000000 +0200 @@ -5403,7 +5403,7 @@ # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! - archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $tmp_verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes @@ -7987,204 +7987,8 @@ fi - succeeded=no - - if test -z "$PKG_CONFIG"; then - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for id3tag" >&5 -echo $ECHO_N "checking for id3tag... $ECHO_C" >&6 - - if $PKG_CONFIG --exists "id3tag" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - succeeded=yes - - echo "$as_me:$LINENO: checking ID3_CFLAGS" >&5 -echo $ECHO_N "checking ID3_CFLAGS... $ECHO_C" >&6 - ID3_CFLAGS=`$PKG_CONFIG --cflags "id3tag"` - echo "$as_me:$LINENO: result: $ID3_CFLAGS" >&5 -echo "${ECHO_T}$ID3_CFLAGS" >&6 - - echo "$as_me:$LINENO: checking ID3_LIBS" >&5 -echo $ECHO_N "checking ID3_LIBS... $ECHO_C" >&6 - ID3_LIBS=`$PKG_CONFIG --libs "id3tag"` - echo "$as_me:$LINENO: result: $ID3_LIBS" >&5 -echo "${ECHO_T}$ID3_LIBS" >&6 - else - ID3_CFLAGS="" - ID3_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ID3_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "id3tag"` - echo $ID3_PKG_ERRORS - fi - - - - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - : - else - { { echo "$as_me:$LINENO: error: Library requirements (id3tag) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (id3tag) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } - fi - - - succeeded=no - - if test -z "$PKG_CONFIG"; then - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for mad" >&5 -echo $ECHO_N "checking for mad... $ECHO_C" >&6 - - if $PKG_CONFIG --exists "mad" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - succeeded=yes - - echo "$as_me:$LINENO: checking MAD_CFLAGS" >&5 -echo $ECHO_N "checking MAD_CFLAGS... $ECHO_C" >&6 - MAD_CFLAGS=`$PKG_CONFIG --cflags "mad"` - echo "$as_me:$LINENO: result: $MAD_CFLAGS" >&5 -echo "${ECHO_T}$MAD_CFLAGS" >&6 - - echo "$as_me:$LINENO: checking MAD_LIBS" >&5 -echo $ECHO_N "checking MAD_LIBS... $ECHO_C" >&6 - MAD_LIBS=`$PKG_CONFIG --libs "mad"` - echo "$as_me:$LINENO: result: $MAD_LIBS" >&5 -echo "${ECHO_T}$MAD_LIBS" >&6 - else - MAD_CFLAGS="" - MAD_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - MAD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mad"` - echo $MAD_PKG_ERRORS - fi - - - - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - : - else - { { echo "$as_me:$LINENO: error: Library requirements (mad) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (mad) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } - fi - - -CFLAGS="$CFLAGS $GTK_CFLAGS $ID3_CFLAGS $MAD_CFLAGS" -LIBS="$LIBS $GTK_LIBS $ID3_LIBS $MAD_LIBS" +CFLAGS="$CFLAGS $GTK_CFLAGS" +LIBS="$LIBS $GTK_LIBS -lmad -lid3tag" if test "x$prefix" = xNONE; then echo $ECHO_N "checking for prefix by $ECHO_C" >&6 diff -ru xmms-mad-0.5.1/src/input.c xmms-mad-0.5.1-patched/src/input.c --- xmms-mad-0.5.1/src/input.c 2002-10-21 01:58:12.000000000 +0200 +++ xmms-mad-0.5.1-patched/src/input.c 2003-07-01 01:35:25.000000000 +0200 @@ -21,6 +21,8 @@ */ #include "config.h" +#include + #ifdef HAVE_ASSERT_H #include #endif /* HAVE_ASSERT_H */ diff -ru xmms-mad-0.5.1/src/xmms-mad.c xmms-mad-0.5.1-patched/src/xmms-mad.c --- xmms-mad-0.5.1/src/xmms-mad.c 2002-10-21 02:05:14.000000000 +0200 +++ xmms-mad-0.5.1-patched/src/xmms-mad.c 2003-07-01 01:42:34.000000000 +0200 @@ -59,6 +59,19 @@ { } +static unsigned long read4BytesBE(int file, unsigned long *check) +{ + unsigned char b; + int i; + for (i = 0; i < 4; i++) + { + if (1 != read (file, &b, 1)) + return -1; + *check = (*check << 8) | b; + } + return 4; +} + static int xmmsmad_is_our_file (char *filename) { @@ -75,18 +88,18 @@ } fin = open (filename, O_RDONLY); - if (fin >= 0 && read (fin, &check, 4) == 4) + if (fin >= 0 && read4BytesBE (fin, &check) == 4) { /* If first two bytes are a sync header or three bytes are "ID3" */ - if ( ((check & 0xf0ff) == 0xf0ff) || ((check & 0xffffff) == 0x334449)) + if ( ((check & 0xfff00000) == 0xfff00000) || ((check & 0xffffff00) == 'ID3\0')) { close (fin); return 1; } - if (check == 0x46464952) /* RIFF RMP3 stream */ + if (check == 'RIFF') /* RIFF RMP3 stream */ { lseek (fin, 4, SEEK_CUR); - if (read (fin, &check, 4) == 4 && check == 0x33504d52) + if (read4BytesBE (fin, &check) == 4 && check == 'RMP3') { close (fin); return 1;