summaryrefslogtreecommitdiff
path: root/plugins/mp3/examples/mplayer.sh.example
diff options
context:
space:
mode:
authorroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
committerroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
commit0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch)
tree11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/mp3/examples/mplayer.sh.example
downloadx-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz
x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2
hello world
Diffstat (limited to 'plugins/mp3/examples/mplayer.sh.example')
-rw-r--r--plugins/mp3/examples/mplayer.sh.example48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/mp3/examples/mplayer.sh.example b/plugins/mp3/examples/mplayer.sh.example
new file mode 100644
index 0000000..a3011eb
--- /dev/null
+++ b/plugins/mp3/examples/mplayer.sh.example
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# This script is called from VDR to start MPlayer
+#
+# argument 1: the file to play
+# argument 2: (optional) the phrase SLAVE if SlaveMode is enabled
+# argument 3: (optional) the phrase AID x to select audio stream x
+
+# where to find mplayer
+MPLAYER="mplayer"
+
+# mplayer options, -vc will be added below
+# add "-lircconf <lircrc>" to enable LIRC support
+OPTS="-vo mpegpes"
+
+# mplayer options for SlaveMode
+SLAVE="-slave -quiet -nolirc"
+
+#####################
+
+FILE=$1
+type=`file "$FILE"`
+
+while shift; do
+ if [ "$1" = "SLAVE" ]; then
+ sopt=$SLAVE
+ elif [ "$1" = "AID" ]; then
+ aopt="-aid $2"
+ shift
+ fi
+done
+
+case "$type" in
+*AVI*)
+ VC="ffdivx"
+ ;;
+*MPEG*)
+ VC="mpegpes"
+ ;;
+*)
+ echo "Unknown video file format $type"
+ echo "Edit mplayer.sh to support this file type"
+ exit 1
+ ;;
+esac
+
+exec $MPLAYER $OPTS -vc $VC $sopt $aopt "$FILE"
+