scripts/winefps: Refactor

master
Pierre Neidhardt 2015-10-15 12:57:03 +02:00
parent 1cea748196
commit 8b0a1a46bd
1 changed files with 5 additions and 5 deletions

View File

@ -9,16 +9,16 @@ EOF
exit
fi
if ! command -v osd_cat >/dev/null; then
echo >&2 "You need osd_cat."
if ! command -v osd_cat >/dev/null 2>&1; then
echo >&2 "osd_cat not found in path."
exit 1
fi
## The unbuffered option is -u on GNU and OpenBSD, -l on others.
OPT_UNBUF=-l
if [ "$(uname)" = "Linux" ] || [ "$(uname)" = "OpenBSD" ]; then
OPT_UNBUF=-u
fi
case "$(uname)" in
Linux|OpenBSD) OPT_UNBUF=-u ;;
esac
WINEDEBUG=fps wine "$@" 2>&1 | tee /dev/stderr | \
sed $OPT_UNBUF -n '/^trace:fps:/{s/.* \([^ ]*\)fps/\1/;p}' | \