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

Execute "GATHER DATA" when using --test #87

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions mkvdts2ac3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ if [ -z $DTSTRACK ]; then
doprint "> mkvmerge -i \"$MKVFILE\" | grep -m 1 \"audio (A_DTS)\" | cut -d ":" -f 1 | cut -d \" \" -f 3"
DTSTRACK="DTSTRACK" #Value for debugging
dopause
if [ $EXECUTE = 1 ]; then
if [ $EXECUTE = 1 ] || [ $PRINT = 1 ]; then
DTSTRACK=$(mkvmerge -i "$MKVFILE" | grep -m 1 "audio (A_DTS)" | cut -d ":" -f 1 | cut -d " " -f 3)

# Check to make sure there is a DTS track in the MVK
Expand All @@ -411,7 +411,7 @@ else
doprint "> mkvmerge -i \"$MKVFILE\" | grep \"Track ID $DTSTRACK: audio (A_DTS)\""
VALID=$"VALID" #Value for debugging
dopause
if [ $EXECUTE = 1 ]; then
if [ $EXECUTE = 1 ] || [ $PRINT = 1 ]; then
VALID=$(mkvmerge -i "$MKVFILE" | grep "Track ID $DTSTRACK: audio (A_DTS)")

if [ -z "$VALID" ]; then
Expand All @@ -430,11 +430,11 @@ doprint "> mkvinfo \"$MKVFILE\""

INFO=$"INFO" #Value for debugging
dopause
if [ $EXECUTE = 1 ]; then
if [ $EXECUTE = 1 ] || [ $PRINT = 1 ]; then
INFO=$(mkvinfo "$MKVFILE")
FIRSTLINE=$(echo "$INFO" | grep -n -m 1 "Track number: $DTSTRACK" | cut -d ":" -f 1)
FIRSTLINE=$(echo "$INFO" | grep -n -m 1 "Track number: $(($DTSTRACK+1))" | cut -d ":" -f 1)
INFO=$(echo "$INFO" | tail -n +$FIRSTLINE)
LASTLINE=$(echo "$INFO" | grep -n -m 1 "Track number: $(($DTSTRACK+1))" | cut -d ":" -f 1)
LASTLINE=$(echo "$INFO" | grep -n -m 1 "Track number: $(($DTSTRACK+2))" | cut -d ":" -f 1)
if [ -z "$LASTLINE" ]; then
LASTLINE=$(echo "$INFO" | grep -m 1 -n "|+" | cut -d ":" -f 1)
fi
Expand All @@ -452,7 +452,7 @@ doprint '> echo "$INFO" | grep -m 1 \"Language\" | cut -d \" \" -f 5'

DTSLANG=$"DTSLANG" #Value for debugging
dopause
if [ $EXECUTE = 1 ]; then
if [ $EXECUTE = 1 ] || [ $PRINT = 1 ]; then
DTSLANG=$(echo "$INFO" | grep -m 1 "Language" | cut -d " " -f 5)
if [ -z "$DTSLANG" ]; then
DTSLANG=$"eng"
Expand All @@ -465,11 +465,11 @@ if [ -z $DTSNAME ]; then
# Get the name for the DTS track specified
doprint ""
doprint $"Extract name for selected DTS track. Change DTS to AC3 and update bitrate if present."
doprint '> echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '"'{gsub(/[0-9]+(\.[0-9]+)?(M|K)bps/,"448Kbps")}1'"''
doprint '> echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '"'{gsub(/[0-9]+(\.[0-9]+).?(M|K)bps/,"448 Kbps")}1'"''
DTSNAME="DTSNAME" #Value for debugging
dopause
if [ $EXECUTE = 1 ]; then
DTSNAME=$(echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '{gsub(/[0-9]+(\.[0-9]+)?(M|K)bps/,"448Kbps")}1')
if [ $EXECUTE = 1 ] || [ $PRINT = 1 ]; then
DTSNAME=$(echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '{gsub(/[0-9]+(\.[0-9]+).?(M|K)bps/,"448 Kbps")}1')
fi
doprint "RESULT:DTSNAME=$DTSNAME"
fi
Expand Down