svn path=/trunk/; revision=129
debug VIDEO: $video
progress(){
+ discard="$(tail -n2 "$statusfile" |sed 's;[^\r];;g' |wc -c)"
+
tail --pid=$$ -f "$statusfile" \
| tr '\r' '\n' \
- | sed -urn '1~5s;^.* V: +([0-9]+)(\.[0-9]+) A-V:.*$;\1;p' \
+ | tail -n+$discard \
+ | sed -urn '1~10s;^.* V: +([0-9]+)(\.[0-9]+) A-V:.*$;\1;p' \
| while read m; do
- printf "%d %d:%02d\n" "$(($m * 100 / $length))" "$(($m / 60))" "$(($m % 60))"
+ printf "%d %d\n" "$(($m * 100 / $length))" "$m"
done \
| while read n; do
[ "$n" != "$previous" ] && printf "%s\n" "$n"
cnt=0
progress \
| while read p t; do
- printf '<span class="progress"><span style="width: %d%%;">%s</span></span>\n' "${p}" "${t}"
+ printf '<span class="progress"><span style="width: %d%%;">%d:%02d</span></span>\n' "${p}" "$(($t / 60))" "$(($t % 60))"
done
# vi:set filetype=html: