[vdr] mplayer.sh and AID 0

C.Y.M syphir at syphir.sytes.net
Sun Jun 26 19:47:43 CEST 2005


C.Y.M wrote:
> I was just debugging mplayer.sh because I could not get it to play a .vdr file
> with an audio track set to "0", then I realized that if the AID is set to 0, the
> mplayer plugin does not actually specify 0 for the AID track (it just leaves it
> blank).  The following changes to mplayer.sh fix the problem.
> 
> while shift; do
>   if [ "$1" = "SLAVE" ]; then
>     declare SLAVE="$1"
>   elif [ "$1" = "AID" ]; then
>     declare AID="-aid $2"
>     shift
>   fi
>   if [ "$AID" = "" ]; then
>     declare AID="-aid 0"
>   fi
> done
> 


Here is a patch for mplayer.sh-0.8.6 which fixes the AID problem for "-aid 0"
and also automatically increments the AID by 1 when an AVI is detected.  There
was also a video resolution missing from the NTSC "direct video" detection.

Regards,
C.



-------------- next part --------------
--- plugins/mplayer.sh.orig	2004-11-06 13:00:00.000000000 -0800
+++ plugins/mplayer.sh	2005-06-26 10:16:27.000000000 -0700
@@ -481,7 +481,17 @@
 declare ORIG_FPS NEW_FPS ORIG_ASPECT VIDEO_FORMAT AUDIO_CODEC
 declare CMDLINE AOUT REMOTE USERDEF SUFFIX
 declare FILE="$1"
-declare SLAVE="$2"
+while shift; do
+  if [ "$1" = "SLAVE" ]; then
+    declare SLAVE="$1"
+  elif [ "$1" = "AID" ]; then
+    declare AID="$2"
+    shift
+  fi
+  if [ "$AID" = "" ]; then
+    declare AID="0"
+  fi
+done
 declare -a XResPAL[0]
 declare -a XResNTSC[0]
 declare FDSTR=""
@@ -540,15 +550,20 @@
     choosebesty
     if test $NEW_X -eq 0 -o $NEW_Y -eq 0; then echolog "*** FATAL: Illegal Resolution ..."; exit; fi
 
+    if test $VIDEO_FORMAT == "DIV3"; then
+      echolog "*** INFO: AVI detected. Increasing AID by 1"
+      AID=$(($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"
+      CMDLINE="$MPLAYER -vo $VO $AOUT -aid $AID $FDSTR $CACHESTR $REMOTE $USERDEF"
     else
-      CMDLINE="$MPLAYER -vo $VO $AOUT -vop $VOP:$NEW_FPS,expand=$NEW_X:$REAL_Y:-1:-1:1,scale=$NEW_X:${NEW_Y}${DETC} $SPEED $FDSTR $CACHESTR $REMOTE $SUBTITLES $USERDEF $FORCEIDX"
+      CMDLINE="$MPLAYER -vo $VO $AOUT -aid $AID -vop $VOP:$NEW_FPS,expand=$NEW_X:$REAL_Y:-1:-1:1,scale=$NEW_X:${NEW_Y}${DETC} $SPEED $FDSTR $CACHESTR $REMOTE $SUBTITLES $USERDEF $FORCEIDX"
     fi
 fi
 


More information about the vdr mailing list