view TOOLS/mpconsole.sh @ 32752:5c39b0060c2c

Use mp_dir_join instead of sprintf. This avoids a potential heap overflow and create a cleaner path: no double "//" in the path for example, or even "\\/" on DOS-like systems.
author cboesch
date Tue, 01 Feb 2011 19:22:43 +0000
parents 305dc504c407
children
line wrap: on
line source

#!/bin/sh
# Script to run mplayer on the console (fbdev/mga_vid/etc) without
# the console text and/or flashing cursor getting in the way.
# Written by Rich Felker.

trap "tput cnorm ; exit 1" SIGQUIT SIGINT EXIT
res=`PATH="$PATH:/usr/sbin" fbset | grep geometry | sed 's/^ *//'`
width=`echo "$res" | cut -d' ' -f2`
height=`echo "$res" | cut -d' ' -f3`
tput civis
clear
mplayer -vo mga -screenw "$width" -screenh "$height" "$@" >/dev/null 2>&1