Commit 4bb8af8b authored by Led's avatar Led

0.13.1

parent 1370cca9
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -28,6 +28,14 @@
# compile PROGRAM [ARGS]...
# `-o FOO.o' is removed from the args passed to the actual compile.
# Usage statement added by Billy Biggs <vektor@dumbterm.net>.
if [ -z $1 ]; then
echo "Wrapper for compilers which do not understand '-c -o'."
echo "usage: compile PROGRAM [ARGS]..."
echo "'-o FOO.o' is removed from the args passed to the actual compile."
exit 1
fi
prog=$1
shift
......
......@@ -139,23 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
eval $set_cc_for_build
cat << EOF > $dummy.c
#include <features.h>
#ifdef __UCLIBC__
# ifdef __UCLIBC_CONFIG_VERSION__
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
# else
LIBC=uclibc
# endif
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
fi
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
......@@ -846,28 +829,28 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-${LIBC}
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-${LIBC}
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-${LIBC}
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
......@@ -890,7 +873,7 @@ EOF
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
......@@ -913,16 +896,16 @@ EOF
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-${LIBC}
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
......@@ -935,37 +918,37 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
echo hppa64-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-${LIBC}
echo x86_64-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
......@@ -980,22 +963,20 @@ EOF
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# This should get integrated into the C code below, but now we hack
if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
......
......@@ -244,7 +244,7 @@ case $basic_machine in
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx | dvp \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
......@@ -276,7 +276,7 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
......@@ -357,7 +357,7 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
......@@ -689,24 +689,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
mipsEE* | ee | ps2)
basic_machine=mips64r5900el-scei
case $os in
-linux*)
;;
*)
os=-elf
;;
esac
;;
iop)
basic_machine=mipsel-scei
os=-irx
;;
dvp)
basic_machine=dvp-scei
os=-elf
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
......@@ -1232,7 +1214,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -irx*)
| -skyos* | -haiku* | -rdos* | -toppers*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@ dnl AC_INIT(src/main.c)
dnl AM_INIT_AUTOMAKE(mpd, 0.13.0)
AC_PREREQ(2.58)
AC_INIT(mpd, 0.13.0, warren.dukes@gmail.com)
AC_INIT(mpd, 0.13.1, warren.dukes@gmail.com)
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
AC_SUBST(MPD_LIBS)
......
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
......
......@@ -33,9 +33,6 @@ basename="s,^.*/,,g"
# function.
progpath="$0"
# define SED for historic ltconfig's generated by Libtool 1.3
test -z "$SED" && SED=sed
# The name of this program:
progname=`echo "$progpath" | $SED $basename`
modename="$progname"
......@@ -46,7 +43,7 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.22
VERSION="1.5.22 Debian 1.5.22-4"
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
# See if we are running on zsh, and set the options which allow our
......@@ -54,13 +51,6 @@ TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
# Same for EGREP, and just to be sure, do LTCC as well
if test "X$EGREP" = X ; then
EGREP=egrep
fi
if test "X$LTCC" = X ; then
LTCC=${CC-gcc}
fi
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
......@@ -147,30 +137,6 @@ preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
if test -z "$max_cmd_len"; then
i=0
testring="ABCD"
new_result=
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
= "XX$testring") >/dev/null 2>&1 &&
new_result=`expr "X$testring" : ".*" 2>&1` &&
max_cmd_len="$new_result" &&
test "$i" != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
testring="$testring$testring"
done
testring=
# Add a significant safety factor because C++ compilers can tack on massive
# amounts of additional arguments before passing them to the linker.
# It appears as though 1/2 is a usable value.
max_cmd_len=`expr $max_cmd_len \/ 2`
fi
#####################################
# Shell function definitions:
# This seems to be the best place for them
......@@ -291,21 +257,7 @@ func_infer_tag ()
esac
CC_quoted="$CC_quoted $arg"
done
# user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
# and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
extendcc=${host}-${CC}
# and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
# (Gentoo-specific hack because we always export $CHOST)
mungedcc=${CHOST-${host}}-${trimedcc}
case "$@ " in
"cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
"gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
tagname=CC
break ;;
"$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
"$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
"$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
......@@ -899,7 +851,7 @@ if test -z "$show_help"; then
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
until $run ln "$progpath" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed"
sleep 2
done
......@@ -2130,7 +2082,10 @@ EOF
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
esac
fi
if test "$pass" = dlopen; then
......@@ -3249,6 +3204,11 @@ EOF
age="$number_minor"
revision="$number_minor"
;;
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit $EXIT_FAILURE
;;
esac
;;
no)
......@@ -3690,13 +3650,6 @@ EOF
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
# It is ok to link against an archive when
# building a shared library.
if $AR -t $potlib > /dev/null 2>&1; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| ${SED} 10q \
| $EGREP "$file_magic_regex" > /dev/null; then
......@@ -5434,11 +5387,6 @@ else
$echo >> $output "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
# Make sure env LD_LIBRARY_PATH does not mess us up
if test -n \"\${LD_LIBRARY_PATH+set}\"; then
export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
fi
"
case $host in
# Backslashes separate directories on plain windows
......@@ -5666,53 +5614,9 @@ fi\
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit $EXIT_FAILURE
fi
if test "X$EGREP" = X ; then
EGREP=egrep
fi
# We do not want portage's install root ($D) present. Check only for
# this if the .la is being installed.
if test "$installed" = yes && test "$D"; then
eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
else
mynewdependency_lib="$libdir/$name"
fi
# Do not add duplicates
if test "$mynewdependency_lib"; then
my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
if test -z "$my_little_ninja_foo_1"; then
newdependency_libs="$newdependency_libs $mynewdependency_lib"
fi
fi
;;
*)
if test "$installed" = yes; then
# Rather use S=WORKDIR if our version of portage supports it.
# This is because some ebuild (gcc) do not use $S as buildroot.
if test "$PWORKDIR"; then
S="$PWORKDIR"
fi
# We do not want portage's build root ($S) present.
my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
# We do not want portage's install root ($D) present.
my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
if test -n "$my_little_ninja_foo_2" && test "$S"; then
mynewdependency_lib=""
elif test -n "$my_little_ninja_foo_3" && test "$D"; then
eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
else
mynewdependency_lib="$deplib"
fi
else
mynewdependency_lib="$deplib"
fi
# Do not add duplicates
if test "$mynewdependency_lib"; then
my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
if test -z "$my_little_ninja_foo_4"; then
newdependency_libs="$newdependency_libs $mynewdependency_lib"
fi
fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
......@@ -5764,10 +5668,6 @@ fi\
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
# Do not add duplicates
if test "$installed" = yes && test "$D"; then
install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
fi
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -350,6 +350,10 @@ static int alsa_errorRecovery(AlsaData * ad, int err)
snd_pcm_close(ad->pcmHandle);
ad->pcmHandle = NULL;
break;
/* this is no error, so just keep running */
case SND_PCM_STATE_RUNNING:
err = 0;
break;
default:
/* unknown state, do nothing */
break;
......@@ -370,7 +374,9 @@ static void alsa_closeDevice(AudioOutput * audioOutput)
AlsaData *ad = audioOutput->data;
if (ad->pcmHandle) {
snd_pcm_drain(ad->pcmHandle);
if (snd_pcm_state(ad->pcmHandle) == SND_PCM_STATE_RUNNING) {
snd_pcm_drain(ad->pcmHandle);
}
snd_pcm_close(ad->pcmHandle);
ad->pcmHandle = NULL;
}
......
......@@ -233,7 +233,7 @@ static ConfigParam *readConfigBlock(FILE * fp, int *count, char *string)
0 == strcmp(array[1], CONF_BLOCK_END)) {
FATAL("improperly formatted config file at line %i: %s\n"
"in block beginning at line %i\n",
*count, string, ret->line);;
*count, string, ret->line);
}
addBlockParam(ret, array[0], array[1], *count);
......
......@@ -44,22 +44,24 @@ void decodeSigHandler(int sig, siginfo_t * si, void *v)
if (sig == SIGCHLD) {
int status;
if (decode_pid == wait3(&status, WNOHANG, NULL)) {
/*
if (WIFSIGNALED(status)) {
if (WTERMSIG(status) != SIGTERM) {
ERROR("decode process died from "
"signal: %i\n", WTERMSIG(status));
}
}
*/
decode_pid = 0;
getPlayerData()->playerControl.decode_pid = 0;
}
} else if (sig == SIGTERM) {
int pid = decode_pid;
if (pid > 0) {
DEBUG("player (or child) got SIGTERM\n");
/* DEBUG("player (or child) got SIGTERM\n"); */
kill(pid, SIGTERM);
} else
DEBUG("decoder (or child) got SIGTERM\n");
} /* else
DEBUG("decoder (or child) got SIGTERM\n"); */
exit(EXIT_SUCCESS);
}
}
......
......@@ -130,20 +130,22 @@ void directory_sigChldHandler(int pid, int status)
{
if (directory_updatePid == pid) {
if (WIFSIGNALED(status) && WTERMSIG(status) != SIGTERM) {
ERROR("update process died from a "
"non-TERM signal: %i\n", WTERMSIG(status));
/* ERROR("update process died from a "
"non-TERM signal: %i\n", WTERMSIG(status)); */
} else if (!WIFSIGNALED(status)) {
switch (WEXITSTATUS(status)) {
case DIRECTORY_UPDATE_EXIT_UPDATE:
directory_reReadDB = 1;
DEBUG("directory_sigChldHandler: "
"updated db\n");
/* DEBUG("directory_sigChldHandler: "
"updated db\n"); */
case DIRECTORY_UPDATE_EXIT_NOUPDATE:
DEBUG("directory_sigChldHandler: "
"update exited succesffully\n");
/* DEBUG("directory_sigChldHandler: "
"update exited succesffully\n"); */
break;
/*
default:
ERROR("error updating db\n");
*/
}
}
clearUpdatePid();
......
......@@ -80,15 +80,13 @@ typedef unsigned flac_read_status_size_t;
# ifdef HAVE_OGGFLAC
# include <OggFLAC/seekable_stream_decoder.h>
# endif
#else /* FLAC_API_VERSION_CURRENT >= 7 */
#else /* FLAC_API_VERSION_CURRENT > 7 */
/* OggFLAC support is handled by our flac_plugin already, and
* thus we *can* always have it if libFLAC was compiled with it */
# ifndef HAVE_OGGFLAC
# define HAVE_OGGFLAC 1
# endif
/*
* OggFLAC support is handled by our flac_plugin already, and
* thus we *can* always have it if libFLAC was compiled with it
*/
# include "_ogg_common.h"
# undef HAVE_OGGFLAC /* we don't need this defined anymore */
# include <FLAC/stream_decoder.h>
# define flac_decoder FLAC__StreamDecoder
......
......@@ -21,10 +21,13 @@
#include "../inputPlugin.h"
#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS)
#include "_flac_common.h"
#include "_ogg_common.h"
#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS) || \
(defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7)
#include "../utils.h"
#include "_ogg_common.h"
#include <string.h>
......
......@@ -24,7 +24,8 @@
#include "../inputPlugin.h"
#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS)
#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS) || \
(defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7)
typedef enum _ogg_stream_type { VORBIS, FLAC } ogg_stream_type;
......
......@@ -173,10 +173,12 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
closeInputStream(inStream);
if (!dc->stop) {
ERROR("Not a valid musepack stream");
return -1;
} else {
dc->state = DECODE_STATE_STOP;
dc->stop = 0;
}
return 0;
}
dc->totalTime = mpc_streaminfo_get_length(&info);
......
......@@ -388,6 +388,8 @@ static int processBytesRead(Interface * interface, int bytesRead)
*(buf_tail - 1) = '\0';
}
ret = processLineOfInput(interface);
if (interface->expired)
return ret;
interface->bufferPos = interface->bufferLength;
}
if (interface->bufferLength == INTERFACE_MAX_BUFFER_LENGTH) {
......
......@@ -50,6 +50,34 @@ static int *listenSockets;
static int numberOfListenSockets;
static int boundPort;
/*
* redirect stdin to /dev/null to work around a libao bug
* there are likely other bugs in other libraries (and even our code!)
* that check for fd > 0, so it's easiest to just keep
* fd = 0 == /dev/null for now...
*/
static void redirect_stdin(void)
{
int fd, st;
struct stat ss;
if ((st = fstat(STDIN_FILENO, &ss)) < 0) {
if ((fd = open("/dev/null", O_RDONLY) > 0)) {
DEBUG("stdin closed, and could not open /dev/null "
"as fd=0, some external library bugs "
"may be exposed...\n");
close(fd);
}
return;
}
if (!isatty(STDIN_FILENO))
return;
if ((fd = open("/dev/null", O_RDONLY)) < 0)
FATAL("failed to open /dev/null %s\n", strerror(errno));
if (dup2(fd, STDIN_FILENO) < 0)
FATAL("dup2 stdin: %s\n", strerror(errno));
}
static int establishListen(unsigned int port,
struct sockaddr *addrp, socklen_t addrlen)
{
......@@ -196,6 +224,7 @@ void listenOnPort(void)
boundPort = port;
redirect_stdin();
do {
parseListenConfigParam(port, param);
} while ((param = getNextConfigParam(CONF_BIND_TO_ADDRESS, param)));
......
......@@ -37,16 +37,6 @@ static int err_fd = -1;
static const char *out_filename;
static const char *err_filename;
/* redirect stdin to /dev/null to work around a libao bug */
static void redirect_stdin(void)
{
int fd;
if ((fd = open("/dev/null", O_RDONLY)) < 0)
FATAL("failed to open /dev/null %s\n", strerror(errno));
if (dup2(fd, STDIN_FILENO) < 0)
FATAL("dup2 stdin: %s\n", strerror(errno));
}
static void redirect_logs(void)
{
assert(out_fd > 0);
......@@ -176,7 +166,6 @@ void setup_log_output(const int use_stdout)
redirect_logs();
stdout_mode = 0;
}
redirect_stdin();
}
#define log_func(func,level,fp) \
......
......@@ -305,7 +305,7 @@ static char *pcm_convertChannels(mpd_sint8 channels, char *inBuffer,
{
static char *buf;
static size_t len;
char *outBuffer = NULL;;
char *outBuffer = NULL;
mpd_sint16 *in;
mpd_sint16 *out;
int inSamples, i;
......
......@@ -38,8 +38,8 @@ typedef struct _ConvState {
mpd_sint8 lastChannels;
mpd_sint32 lastInSampleRate;
mpd_sint32 lastOutSampleRate;
int error;
#endif
int error;
} ConvState;
void pcm_volumeChange(char *buffer, int bufferSize, AudioFormat * format,
......
......@@ -85,6 +85,7 @@ void player_sigChldHandler(int pid, int status)
{
if (player_pid == pid)
{
/*
DEBUG("SIGCHLD caused by player process\n");
if (WIFSIGNALED(status) &&
WTERMSIG(status) != SIGTERM &&
......@@ -93,17 +94,20 @@ void player_sigChldHandler(int pid, int status)
ERROR("player process died from signal: %i\n",
WTERMSIG(status));
}
*/
resetPlayer();
}
else if (pid == getPlayerData()->playerControl.decode_pid &&
player_pid <= 0)
{
/*
if (WIFSIGNALED(status) && WTERMSIG(status) != SIGTERM)
{
ERROR("(caught by master parent) "
"decode process died from a "
"non-TERM signal: %i\n", WTERMSIG(status));
}
*/
getPlayerData()->playerControl.decode_pid = 0;
}
}
......
......@@ -65,7 +65,7 @@
static Playlist playlist;
static int playlist_state = PLAYLIST_STATE_STOP;
static int playlist_max_length = DEFAULT_PLAYLIST_MAX_LENGTH;
int playlist_max_length = DEFAULT_PLAYLIST_MAX_LENGTH;
static int playlist_stopOnError;
static int playlist_errorCount;
static int playlist_queueError;
......@@ -221,8 +221,7 @@ int clearPlaylist(int fd)
int clearStoredPlaylist(int fd, char *utf8file)
{
removeAllFromStoredPlaylistByPath(fd, utf8file);
return 0;
return removeAllFromStoredPlaylistByPath(fd, utf8file);
}
int showPlaylist(int fd)
......
......@@ -47,6 +47,8 @@ typedef struct _Playlist {
extern int playlist_saveAbsolutePaths;
extern int playlist_max_length;
void initPlaylist(void);
void finishPlaylist(void);
......
......@@ -62,7 +62,7 @@ static void chldSigHandler(int signal)
{
int status;
int pid;
DEBUG("main process got SIGCHLD\n");
/* DEBUG("main process got SIGCHLD\n"); */
while (0 != (pid = wait3(&status, WNOHANG, NULL))) {
if (pid < 0) {
if (errno == EINTR)
......
......@@ -191,6 +191,9 @@ StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd)
slength = 0;
temp = fsCharsetToUtf8(s);
if (temp && !commentCharFound) {
if (sp->list->numberOfNodes >=
(playlist_max_length - 1))
goto out;
song = getSongFromDB(temp);
if (song) {
appendSongToStoredPlaylist(sp, song);
......@@ -424,17 +427,29 @@ int appendSongToStoredPlaylistByPath(int fd, const char *utf8path, Song *song)
char *filename;
FILE *file;
char *s;
int nr_songs = 0;
char path_max_tmp[MAXPATHLEN + 1];
filename = utf8pathToFsPathInStoredPlaylist(utf8path, fd);
if (!filename)
return -1;
while (!(file = fopen(filename, "a")) && errno == EINTR);
while (!(file = fopen(filename, "a+")) && errno == EINTR);
if (file == NULL) {
commandError(fd, ACK_ERROR_NO_EXIST, "could not open file "
"\"%s\": %s", filename, strerror(errno));
return -1;
}
while (myFgets(path_max_tmp, sizeof(path_max_tmp), file)) {
if (path_max_tmp[0] != PLAYLIST_COMMENT &&
(++nr_songs >= playlist_max_length))
break;
}
if (nr_songs >= playlist_max_length) {
commandError(fd, ACK_ERROR_PLAYLIST_MAX,
"playlist is at the max size");
return -1;
}
if (playlist_saveAbsolutePaths && song->type == SONG_TYPE_FILE)
s = rmp2amp(utf8ToFsCharset(getSongUrl(song)));
......@@ -461,11 +476,19 @@ int renameStoredPlaylist(int fd, const char *utf8from, const char *utf8to)
char *to;
int ret = 0;
from = xstrdup(utf8pathToFsPathInStoredPlaylist(utf8from, fd));
from = utf8pathToFsPathInStoredPlaylist(utf8from, fd);
if (!from)
return -1;
from = xstrdup(from);
if (!from)
return -1;
to = xstrdup(utf8pathToFsPathInStoredPlaylist(utf8to, fd));
to = utf8pathToFsPathInStoredPlaylist(utf8to, fd);
if (!to) {
free(from);
return -1;
}
to = xstrdup(to);
if (!to) {
free(from);
return -1;
......
......@@ -297,10 +297,12 @@ static void avahiClientCallback(AvahiClient *c, AvahiClientState state, void *us
int reason = avahi_client_errno(c);
if( reason == AVAHI_ERR_DISCONNECTED ) {
LOG( "Avahi: Client Disconnected, will reconnect shortly\n");
avahi_entry_group_free( avahiGroup );
avahiGroup = NULL;
avahi_client_free( avahiClient );
avahiClient = NULL;
if (avahiGroup) {
avahi_entry_group_free(avahiGroup);
avahiGroup = NULL;
}
if (avahiClient)
avahi_client_free(avahiClient);
avahiClient = avahi_client_new( &avahiPoll, AVAHI_CLIENT_NO_FAIL,
avahiClientCallback, NULL, &reason );
if( !avahiClient ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment