From c6fdc541aa45feeae264e7c61c37d018ffd84bca Mon Sep 17 00:00:00 2001 From: fredrik Date: Sat, 24 Nov 2007 01:02:11 +0000 Subject: [PATCH] planime can now load {a,s}{lang,id} from info file. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@1109 959494ce-11ee-0310-bf91-de5d638817bd --- planime | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/planime b/planime index ed79ec9..b2b14dd 100755 --- a/planime +++ b/planime @@ -127,10 +127,12 @@ fi case "${file##*.}" in ogm) - defopts=(-aid 1 -sid 0) + aid=1 + sid=0 ;; mkv) - defopts=(-slang eng -alang jpn) + alang=jpn + slang=eng ;; esac @@ -155,12 +157,33 @@ if [ -r "$ifile" ]; then cmdline=("${cmdline[@]}" -delay "$arg") elif [ "$par" = aspect ]; then cmdline=("${cmdline[@]}" -aspect "$arg") + elif [ "$par" = alang ]; then + unset alang aid + alang="$arg" + elif [ "$par" = aid ]; then + unset alang aid + aid="$arg" + elif [ "$par" = slang ]; then + unset slang sid + slang="$arg" + elif [ "$par" = sid ]; then + unset slang sid + sid="$arg" fi done exec 0<&3 exec 3<&- -else - cmdline=("${cmdline[@]}" "${defopts[@]}") +fi + +if [ -n "$alang" ]; then + cmdline=("${cmdline[@]}" -alang "$alang") +elif [ -n "$aid" ]; then + cmdline=("${cmdline[@]}" -aid "$aid") +fi +if [ -n "$slang" ]; then + cmdline=("${cmdline[@]}" -slang "$slang") +elif [ -n "$sid" ]; then + cmdline=("${cmdline[@]}" -sid "$sid") fi if [ "`hostname`" = pc6 ]; then chwp=y; fi -- 2.11.0