diff --git a/contrib/mt-daapd-ssc.sh b/contrib/mt-daapd-ssc.sh index 03477ec8..c8f0176f 100755 --- a/contrib/mt-daapd-ssc.sh +++ b/contrib/mt-daapd-ssc.sh @@ -13,16 +13,16 @@ OGGDEC=oggdec FLAC=flac ogg_file() { - $OGGDEC --quiet -o - "$1" | $WAVSTREAMER -o $2 -l $3 + $OGGDEC --quiet -o - "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN } flac_file() { - $FLAC --silent --decode --stdout "$1" | $WAVSTREAMER -o $2 -l $3 + $FLAC --silent --decode --stdout "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN } +FILE=$1 OFFSET=0 -FORGELEN=0 if [ "$2" == "" ]; then OFFSET=0 @@ -31,19 +31,17 @@ else fi -if [ "$3" == "" ]; then - FORGELEN=0 -else - FORGELEN=$3 +if [ "$3" != "" ]; then + FORGELEN="-l $3" fi if ( echo $1 | grep -i "\.ogg$" > /dev/null 2>&1 ); then - ogg_file $1 $OFFSET $FORGELEN + ogg_file exit; fi if ( echo $1 | grep -i "\.flac$" > /dev/null 2>&1 ); then - flac_file $1 $OFFSET $FORGELEN + flac_file exit; fi