I modified mplayer.sh to have checkpoints, as illustrated here:

#!/bin/sh
app=mplayer
scriptpid=$$
apppid=/tmp/.alienbbc-app.$$.pid

# For mplayer pre7 and later comment out following line and uncomment
line after
if [ -e "${12}" ] || [ -e "${13}" ] ; then
# if [ -e "${10}" ] ; then
echo Local File: Launching $app $1 $2 $3 $4 $5 $6 $7 $8 $9 "${10}"
${11} "${12}" "${13}" >&2
$app $1 $2 $3 $4 $5 $6 $7 $8 $9 "${10}" ${11} "${12}" "${13}" 3>&1
1>&2
exit
fi

echo Streaming: Launching $app $* >&2
(
echo checkpoint 1 >&2
$app $* 3>&1 1>&2 & 
echo checkpoint 2 >&2
echo $! > $apppid
echo checkpoint 3 >&2
wait
echo checkpoint 4 >&2
rm -f $apppid
echo checkpoint 5 >&2
kill $scriptpid 2> /dev/null
echo checkpoing 6 >&2
) < /dev/null &

cat > /dev/null
if [ -s $apppid ] ; then
kill `cat $apppid` 2> /dev/null
fi

The logs show checkpoint 3 being printed out, but checkpoint 4 is not. 
So it seems the problem is precisely with the "wait".  I'm not as
familiar as I should be with shell script programming on MacOS -- why
isn't wait returning?


-- 
tygar
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to