#!/bin/sh
#
# configure PVR (mostly IVTV based) cards for MPlayer
#
# runlevels: geexbox, debug

# set pvr arguments for PVR cards.
if [ -e /var/use_pvr ]; then
  echo "### Configuring PVR cards for MPlayer ###"

  # include PVR configuration file
  . /etc/pvr

  mp_set_option pvr "aspect=$PVR_ASPECT:arate=$PVR_AUDIO_RATE:alayer=$PVR_AUDIO_LAYER:abitrate=$PVR_AUDIO_BITRATE:amode=$PVR_AUDIO_MODE:vbitrate=$PVR_VIDEO_BITRATE:vmode=$PVR_VIDEO_MODE:vpeak=$PVR_VIDEO_PEAK_BITRATE:fmt=$PVR_VIDEO_FORMAT"
else
  # remove pvr from menu
  sed -i 's%.*ok="loadfile pvr://".*%%' /etc/mplayer/menu.conf
fi

exit 0
