You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-video/mplayer-sh/files/mplayer-sh-0.8.7-parameter-...

85 lines
3.5 KiB

--- mplayer.sh.orig 2007-02-11 16:34:07.000000000 +0100
+++ mplayer.sh 2007-05-05 18:17:48.000000000 +0200
@@ -12,6 +12,7 @@
# - calculate USE_SPEED with 30 fps instead of 29.97
# - use '-vf' and '-af' instead of '-vop' and '-aop', as the
# latter are deprecated
+# - add -aid to mplayer when AID is given (Matthias Schwarzott <zzam@gentoo.org>)
#
# 0.8.6 - fixed a copy'n'paste bug regarding the subtitle background
# alpha color (thanks to Christian Haider)
@@ -215,6 +216,11 @@
fi
debugvar REMOTE "$REMOTE"
+ if test -n "${AID}"; then
+ AUDIO="-aid ${AID}"
+ fi
+ debugvar AUDIO "${AUDIO}"
+
if ! test -z "$USERDEF"; then echolog "*** Use Option USERDEF at your own risk!"; fi
debugvar USERDEF "$USERDEF"
@@ -485,15 +491,24 @@
declare -i NEW_X NEW_Y
declare -i HALF_Y FULL_Y
declare ORIG_FPS NEW_FPS ORIG_ASPECT VIDEO_FORMAT AUDIO_CODEC
-declare CMDLINE AOUT REMOTE USERDEF SUFFIX
+declare CMDLINE AOUT REMOTE AUDIO USERDEF SUFFIX
declare FILE="$1"
-declare SLAVE="$2"
+shift
declare -a XResPAL[0]
declare -a XResNTSC[0]
declare FDSTR=""
declare SUBTITLES=""
declare DETC=""
+while [[ -n $1 ]]; do
+ case ${1} in
+ SLAVE) SLAVE=SLAVE ;;
+ AID) AID=${2}; shift ;;
+ esac
+
+ shift
+done
+
echolog "*** Starting mplayer.sh Version $VERSION"
if test -z "$FILE"; then echolog "*** USAGE: mplayer.sh <File_to_be_played>"; exit; fi
@@ -511,18 +526,18 @@
if test \( "$FILE" == "$DVDFiles/DVD" -o "$FILE" == "$DVDFiles/VCD" \) -a -n "$DVDFiles" -a -n "$DVD"; then
if test "$FILE" == "$DVDFiles/DVD"; then
$USEAC3 && AOUT="$AC3AOUT"
- CMDLINE="$MPLAYER -vo $VO $AOUT -alang $DVDLANG $DVDOPTIONS $FDSTR $CACHESTR $REMOTE $USERDEF -dvd-device $DVD dvd://"
+ CMDLINE="$MPLAYER -vo $VO $AOUT -alang $DVDLANG $DVDOPTIONS $FDSTR $CACHESTR $AUDIO $REMOTE $USERDEF -dvd-device $DVD dvd://"
fi
if test "$FILE" == "$DVDFiles/VCD"; then
- CMDLINE="$MPLAYER -vo $VO $AOUT $VCDOPTIONS $FDSTR $CACHESTR $REMOTE $USERDEF -cdrom-device $DVD vcd://"
+ CMDLINE="$MPLAYER -vo $VO $AOUT $VCDOPTIONS $FDSTR $CACHESTR $AUDIO $REMOTE $USERDEF -cdrom-device $DVD vcd://"
fi
unset FILE
elif test "${SUFFIX}" == ".cue"; then
if $MPLAYER_V1; then
- CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $REMOTE $USERDEF cue://$FILE:2"
+ CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $AUDIO $REMOTE $USERDEF cue://$FILE:2"
unset FILE
else
- CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $REMOTE $USERDEF -vcd 2 -cuefile"
+ CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $AUDIO $REMOTE $USERDEF -vcd 2 -cuefile"
fi
else
# Try to determine the video attributes
@@ -552,9 +567,9 @@
\( $NTSC -a $NEW_FPS == "30" -a \( \( $ORIG_X == "352" -a $ORIG_Y == "240" \) -o \( $ORIG_Y == "480" -a \
\( $ORIG_X == "352" -o $ORIG_X == "480" -o $ORIG_X == "512" -o $ORIG_X == "544" -o $ORIG_X == "640" -o $ORIG_X == "704" -o $ORIG_X == "720" \) \) \) \) \
\) ; then
- CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $REMOTE $USERDEF"
+ CMDLINE="$MPLAYER -vo $VO $AOUT $FDSTR $CACHESTR $AUDIO $REMOTE $USERDEF"
else
- CMDLINE="$MPLAYER -vo $VO $AOUT -vf scale=$NEW_X:${NEW_Y}${DETC},expand=$NEW_X:$REAL_Y:-1:-1:1,$VOP:$NEW_FPS $SPEED $FDSTR $CACHESTR $REMOTE $SUBTITLES $USERDEF $FORCEIDX"
+ CMDLINE="$MPLAYER -vo $VO $AOUT -vf scale=$NEW_X:${NEW_Y}${DETC},expand=$NEW_X:$REAL_Y:-1:-1:1,$VOP:$NEW_FPS $SPEED $FDSTR $CACHESTR $AUDIO $REMOTE $SUBTITLES $USERDEF $FORCEIDX"
fi
fi