case "${file##*.}" in
ogm)
- defopts=(-aid 1 -sid 0)
+ aid=1
+ sid=0
;;
mkv)
- defopts=(-slang eng -alang jpn)
+ alang=jpn
+ slang=eng
;;
esac
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