]> code.delx.au - transcoding/commitdiff
fix-pal-speedup: operate on a single file
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 22 Feb 2016 12:09:22 +0000 (23:09 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 22 Feb 2016 12:09:22 +0000 (23:09 +1100)
fix-pal-speedup

index 05a4b9aa8bcbb650160996a82ff4e7dd83e8ba2f..b8cee2cd7fb7ce45edc4084f34d07a78a94d7a32 100755 (executable)
@@ -6,7 +6,7 @@
 # slowed, and encoded as AAC, preserving surround sound.
 
 if [ -z "$1" -o -z "$2" ]; then
-    echo "Usage: $0 destdir infile [infile ...]"
+    echo "Usage: $0 infile outfile"
     exit 1
 fi
 
@@ -42,19 +42,8 @@ function convert_file {
 }
 
 
-destdir="$1"
-shift
-
-for infile in "$@"; do
-    outfile="$destdir/$(basename "$infile")"
-
-    if [ -f "$outfile" ]; then
-        echo "Not overwriting $outfile"
-        continue
-    fi
-
-    tmpdir="$(mktemp -d "${TMPDIR:-/var/tmp}/pal-XXXXXXXX")"
-    convert_file "$infile" "$outfile"
-    rm -rf "$tmpdir"
-done
-
+infile="$1"
+outfile="$2"
+tmpdir="$(mktemp -d "${TMPDIR:-/var/tmp}/pal-XXXXXXXX")"
+convert_file "$infile" "$outfile"
+rm -rf "$tmpdir"