#!/bin/sh
#
# configure MPlayer's video settings
#
# runlevels: geexbox, debug, configure

echo "### Configuring MPlayer's video settings ###"

# set mplayer for X server
if [ -f /usr/bin/Xorg -a -f /var/use_xorg ]; then
  mp_set_option vo "xv,xvidix,x11"
  mp_set_option display ":0"
  mp_set_option vsync "no"
  mp_set_option fixed-vo "no"
  mp_set_option nomouseinput "yes"
  mp_set_option nograbpointer "yes"
  mp_set_option stop-xscreensaver "yes"
  exit 0
fi

# set mplayer resolution when using offb
if [ -e /dev/fb0 ]; then
  RES=`/usr/sbin/fbset | sed -n 's/mode "\(.*\)-.*"/\1/p'`
  RESX=`echo $RES | cut -f1 -dx`
  RESY=`echo $RES | cut -f2 -dx`
  mp_set_option screenw "$RESX"
  mp_set_option screenh "$RESY"
else
  mp_set_option screenw 800
  mp_set_option screenh 600
fi

exit 0
