C.Y.M wrote:
Juri Haberland wrote:
"C.Y.M" syphir@syphir.sytes.net wrote:
- Mplayer prefers to default to APID 1 over APID 0 (probably a mplayer problem,
not a mplayer plugin problem).
For what do you need the AID stuff anyway, now that audio switching works?
I just want the mplayer plugin to default to the primary audio track when playing back a .vdr file. The way it is now, if I dont specify AID 0, it will always default to the secondary audio track (if it exists) when playing back .vdr files.
With the latest patch to mplayer, the following changes to mplayer.sh work for me.. :) Thanks. Of course more file type cases should be added (like the one for AVI) if you want to use the default AID configuration. Now I can use mplayers default AID auto detection, or I can set the AID of my choice.
C.
--- mplayer.sh 2004-11-06 13:00:00.000000000 -0800 +++ /etc/vdr/plugins/mplayer.sh 2005-07-02 12:30:33.000000000 -0700 @@ -178,7 +178,7 @@ if test -z "$VO"; then errorcfg VO; exit; else debugvar VO "$VO"; fi
if test -z "$AO"; then errorcfg AO; exit; else debugvar AO "$AO"; fi - AOUT="-ao $AO" + AOUT="-ao $AO $AID"
if test -z $CACHE; then echolog "*** Option CACHE not set in config file - calling mplayer without Cache!" @@ -481,7 +481,16 @@ declare ORIG_FPS NEW_FPS ORIG_ASPECT VIDEO_FORMAT AUDIO_CODEC declare CMDLINE AOUT REMOTE USERDEF SUFFIX declare FILE="$1" -declare SLAVE="$2" +declare DETECT="1" +while shift; do + if [ "$1" = "SLAVE" ]; then + declare SLAVE="$1" + elif [ "$1" = "AID" ]; then + declare AID="-aid $2" + declare DETECT="0" + shift + fi +done declare -a XResPAL[0] declare -a XResNTSC[0] declare FDSTR="" @@ -540,11 +549,16 @@ choosebesty if test $NEW_X -eq 0 -o $NEW_Y -eq 0; then echolog "*** FATAL: Illegal Resolution ..."; exit; fi
+ if test $DETECT == "0" -a ( $VIDEO_FORMAT == "DIV3" -o $VIDEO_FORMAT == "XVID" ) ; then + echolog "*** INFO: AVI file format detected. Setting AID to 1" + AOUT="-ao $AO -aid 1" + fi + if test $MPEG_DIRECT == "true" -a ( $VIDEO_FORMAT == "0x10000001" -o $VIDEO_FORMAT == "0x10000002" ) -a ( \ ( $PAL -a $NEW_FPS == "25" -a ( ( $ORIG_X == "352" -a $ORIG_Y == "288" ) -o ( $ORIG_Y == "576" -a \ ( $ORIG_X == "352" -o $ORIG_X == "480" -o $ORIG_X == "528" -o $ORIG_X == "544" -o $ORIG_X == "688" -o $ORIG_X == "704" -o $ORIG_X == "720" ) ) ) ) -o \ ( $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 == "640" -o $ORIG_X == "704" -o $ORIG_X == "720" ) ) ) ) \ + ( $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" else