From e90c7569ceb5cef79cc938375a7e2053ea788578 Mon Sep 17 00:00:00 2001 From: lace <> Date: Sun, 19 Nov 2006 10:11:20 +0000 Subject: [PATCH] *** empty log message *** --- bin/engine-di.fm | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/bin/engine-di.fm b/bin/engine-di.fm index 1cd49e7..175f299 100755 --- a/bin/engine-di.fm +++ b/bin/engine-di.fm @@ -37,25 +37,27 @@ if false;then exec mplayer -ao oss:/dev/dsp -cache 128 "$stream" "$@" exit 1 else - streamlist="`lynx -source http://${pathslashed}|sed -n \ - -e 's/^File[0-9]*=//p' \ - -e 's#^.*"\(mms://[^"]*\)".*$#\1#p' \ - |tr -d '\r'`" - for stream in $streamlist;do - # Using "set -e" here: - # mplayer rc 0 on failure to read the stream - # mplayer rc 0 on 'q' - # mplayer rc 1 on ctrl-c - ip="` echo "$stream"|sed -n 's#^http://\([^:/]*\).*$#\1#p'`" - if [ -n "$ip" ];then - port="`echo "$stream"|sed -n 's#^http://[^:/]*:\([0-9][0-9]*\).*$#\1#p'`" - port="${port:-80}" - echo >&2 "Checking $stream -> {$ip}:{$port} ..." - if ! nc -w 2 "$ip" "$port";then - echo >&2 "TIMEOUT: $stream" - continue + while :;do + streamlist="`lynx -source http://${pathslashed}|sed -n \ + -e 's/^File[0-9]*=//p' \ + -e 's#^.*"\(mms://[^"]*\)".*$#\1#p' \ + |tr -d '\r'`" + for stream in $streamlist;do + # Using "set -e" here: + # mplayer rc 0 on failure to read the stream + # mplayer rc 0 on 'q' + # mplayer rc 1 on ctrl-c + ip="` echo "$stream"|sed -n 's#^http://\([^:/]*\).*$#\1#p'`" + if [ -n "$ip" ];then + port="`echo "$stream"|sed -n 's#^http://[^:/]*:\([0-9][0-9]*\).*$#\1#p'`" + port="${port:-80}" + echo >&2 "Checking $stream -> {$ip}:{$port} ..." + if ! nc -w 2 "$ip" "$port";then + echo >&2 "TIMEOUT: $stream" + continue + fi fi - fi - mplayer -ao oss:/dev/dsp -cache 128 "$stream" "$@" + mplayer -ao alsa:device=hw=0 -cache 128 "$stream" "$@" + done done fi -- 1.8.3.1