planime can now load {a,s}{lang,id} from info file.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 24 Nov 2007 01:02:11 +0000 (01:02 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 24 Nov 2007 01:02:11 +0000 (01:02 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@1109 959494ce-11ee-0310-bf91-de5d638817bd

planime

diff --git a/planime b/planime
index ed79ec9..b2b14dd 100755 (executable)
--- a/planime
+++ b/planime
@@ -127,10 +127,12 @@ fi
 
 case "${file##*.}" in
     ogm)
 
 case "${file##*.}" in
     ogm)
-       defopts=(-aid 1 -sid 0)
+       aid=1
+       sid=0
        ;;
     mkv)
        ;;
     mkv)
-       defopts=(-slang eng -alang jpn)
+       alang=jpn
+       slang=eng
        ;;
 esac
 
        ;;
 esac
 
@@ -155,12 +157,33 @@ if [ -r "$ifile" ]; then
            cmdline=("${cmdline[@]}" -delay "$arg")
        elif [ "$par" = aspect ]; then
            cmdline=("${cmdline[@]}" -aspect "$arg")
            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<&-
        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
 fi
 
 if [ "`hostname`" = pc6 ]; then chwp=y; fi