Backwards compatability for those still using AACENCOPTS
authorAndrew Strong <andrew.david.strong@gmail.com>
Thu, 9 Apr 2015 10:45:11 +0000 (20:45 +1000)
committerAndrew Strong <andrew.david.strong@gmail.com>
Thu, 9 Apr 2015 10:45:11 +0000 (20:45 +1000)
abcde

diff --git a/abcde b/abcde
index 085d8d0..847377a 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -4012,17 +4012,35 @@ case "$APENCODERSYNTAX" in
                ;;
 esac
 case "$AACENCODERSYNTAX" in
+    # Some elaborate 'if' work to keep backward compatability for those
+    # who don't realise that AACENCOPTS does not work with abcde from
+    # version 2.6.1 onwards.                                  Andrew.
        faac)
-               AACENCODEROPTS="${AACENCODEROPTSCLI:-$FAACENCOPTS}"
-               AACENCODER="$FAAC"
+           if [ -z "$FAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then
+             AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}"
+                 AACENCODER="$FAAC"
+               else
+                 AACENCODEROPTS="${AACENCODEROPTSCLI:-$FAACENCOPTS}"
+                 AACENCODER="$FAAC"
+               fi
                ;;
        neroAacEnc)
-               AACENCODEROPTS="${AACENCODEROPTSCLI:-$NEROAACENCOPTS}"
-               AACENCODER="$NEROAACENC"
+           if [ -z "$NEROAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then
+             AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}"
+                 AACENCODER="$NEROAACENC"
+               else        
+                 AACENCODEROPTS="${AACENCODEROPTSCLI:-$NEROAACENCOPTS}"
+                 AACENCODER="$NEROAACENC"
+               fi
                ;;
        fdkaac)
-               AACENCODEROPTS="${AACENCODEROPTSCLI:-$FDKAACENCOPTS}"
-               AACENCODER="$FDKAAC"
+           if [ -z "$FDKAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then
+             AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}"
+                 AACENCODER="$FDKAAC"
+               else
+                AACENCODEROPTS="${AACENCODEROPTSCLI:-$FDKAACENCOPTS}"
+                AACENCODER="$FDKAAC"
+               fi
                ;;
 esac