Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer expression expected error #79

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ argument.
--md5 Perform MD5 comparison when copying across drives.
-n, --no-dts Do not retain the DTS track.
--new Do not copy over original. Create new adjacent file.
--no-subs Do not retain subtitles.
-p PRIORITY Modify niceness of executed commands.
-s MODE,
--compress MODE Apply header compression to streams (See mkvmerge's --compression).
Expand All @@ -86,6 +87,7 @@ configuration file to automatically set them. Copy the following to

#EXTERNAL=1
#NODTS=1
#NOSUBS=1
#KEEPDTS=1
#DEFAULT=1
#FORCE=1
Expand Down Expand Up @@ -219,7 +221,7 @@ The following people contributed useful thoughts or code to `mkvdts2ac3`:
* Florian Coulmier - Bug reports and patches.
* NameLessJedi - Header compression disabling suggestion.
* d4nyl0 - Transition to ffmpeg
* n-i-x - Progress display on file copy
* Jeff Rebeiro (n-i-x) - Progress display on file copy, `--no-subs` argument to remove subtitles.

And to everyone who submitted bug reports through email and on networkedmediatank.com!

Expand Down
11 changes: 10 additions & 1 deletion mkvdts2ac3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ displayhelp() {
echo " --md5 Perform MD5 comparison when copying across drives."
echo " -n, --no-dts Do not retain the DTS track."
echo " --new Do not copy over original. Create new adjacent file."
echo " --no-subs Do not retain subtitles."
echo " -p PRIORITY Modify niceness of executed commands."
echo " -s MODE,"
echo " --compress MODE Apply header compression to streams (See mkvmerge's --compression)."
Expand Down Expand Up @@ -249,6 +250,9 @@ while [ -z "$MKVFILE" ]; do
"--new" ) # Do not overwrite original. Create new adjacent file.
NEW=1
;;
"--no-subs" ) # Do not retain subtitles.
NOSUBS=1
;;
"-p" ) # Move required priority value "up"
shift
PRIORITY=$1
Expand Down Expand Up @@ -601,6 +605,11 @@ else
CMD="$CMD --sync 0:$DELAY"
fi

# If the user wants to remove the subtitles then add the appropriate arguments to command
if [ $NOSUBS ]; then
CMD="$CMD --no-subtitles"
fi

# Set track compression scheme and append new AC3
CMD="$CMD --compression 0:$COMP \"$AC3FILE\""

Expand Down Expand Up @@ -661,7 +670,7 @@ else
# Check there is enough free space for the new file
if [ $EXECUTE = 1 ]; then
MKVFILEDIFF=$(($($DUCMD "$NEWFILE" | cut -f1) - $MKVFILESIZE))
DESTFREESPACE=$(\df -k "$DEST" | tail -1 | awk '{print $4*1024}')
DESTFREESPACE=$(\df -k "$DEST" | tail -1 | awk '{printf ("%0.0f", $4*1024)}')
if [ $MKVFILEDIFF -gt $DESTFREESPACE ]; then
error $"There is not enough free space to copy the new MKV over the old one. Free up some space and then copy '$NEWFILE' over '$MKVFILE'."
exit 1
Expand Down