#!/bin/sh

# This script handles auto-playing of movie CDs/DVDs
# (intended to be used by mmounter as a mount replacement)

# This needs to be updated to read content.ini and handle 
# filenames containing spaces

mount $*
if [ -e $2/content.ini ]; then
	VIDEO_FILE=`grep Video= $2/content.ini | cut -d = -f 2`
	if [ -e "$2/$VIDEO_FILE" ]; then
		mplayer-script "$2/$VIDEO_FILE" -vo sdl -fs -vc ffdivx -osdlevel 0 -cache 16000 &> /tmp/mplayerlog &
	fi
elif [ -d $2/video_ts ] || [ -d $2/VIDEO_TS ]; then
#	mplayer-script -vo dxr3 -vc mpegpes -DVD 1 &> /tmp/mplayerlog &
#	xine-script -V dxr3 -pfhq dvdnav:// &> /tmp/xinelog &
	xine-script -Vxv -pfhq dvdnav:// &> /tmp/xinelog &
fi
