X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=pages%2Fplayctl.sh;h=c4ece2c85c97ac1f15ac501f405bc37f5c14af8d;hb=1be65d11fc6ac0693f72ca442fcc4ccb24fd746a;hp=c5d6c09fb1e9f30d7d5751ae79e30843b5a5e542;hpb=aa4516d7090b7818127a1dd39a281059d3e042cc;p=serve0 diff --git a/pages/playctl.sh b/pages/playctl.sh index c5d6c09..c4ece2c 100755 --- a/pages/playctl.sh +++ b/pages/playctl.sh @@ -45,9 +45,12 @@ debug VIDEO: $video progress(){ tail --pid=$$ -f "$statusfile" \ | tr '\r' '\n' \ - | sed -urn 's;^.* ([0-9]{1,3})(,[0-9]+)?% *$;\1;p' \ + | sed -urn '1~5s;^.* V: +([0-9]+)(\.[0-9]+) A-V:.*$;\1;p' \ + | while read m; do + printf "%s\n" "$(($m * 100 / $length))" + done \ | while read n; do - [ "$n" != "$previous" ] && printf "%s\n" "$((100 - $n))" + [ "$n" != "$previous" ] && printf "%s\n" "$n" previous=$n done }