From 81fbd51042d6f65c1d2f0499f2d1cf19fa92cd72 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 5 Oct 2003 22:41:32 +0000 Subject: [PATCH] Fixed the wrong translation of track selections into command line options. --- ChangeLog | 8 ++++++++ src/mmg/mmg.cpp | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8e5951e5..92afc9e6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-10-06 Moritz Bunkus + + * mmg: bug fix: Audio, video and subtitle track selection was + translated into the wrong command line options. + + * mkvmerge: Replaced the avilib based AVI reading functions with + AVI classes from Cyrius. + 2003-10-03 Moritz Bunkus * Released v0.7.1. diff --git a/src/mmg/mmg.cpp b/src/mmg/mmg.cpp index 9e966031e..9d82bc43d 100644 --- a/src/mmg/mmg.cpp +++ b/src/mmg/mmg.cpp @@ -535,7 +535,7 @@ void mmg_dialog::update_command_line() { mmg_file_t *f; mmg_track_t *t; mmg_attachment_t *a; - wxString sid, old_cmdline, arg; + wxString sid, old_cmdline, arg, aids, sids, dids; old_cmdline = cmdline; cmdline = "\"" + mkvmerge_path + "\" -o \"" + tc_output->GetValue() + "\" "; @@ -551,6 +551,9 @@ void mmg_dialog::update_command_line() { no_audio = true; no_video = true; no_subs = true; + aids = ""; + sids = ""; + dids = ""; for (tidx = 0; tidx < f->tracks->size(); tidx++) { string format; @@ -564,9 +567,9 @@ void mmg_dialog::update_command_line() { if (t->type == 'a') { no_audio = false; - cmdline += "-a " + sid + " "; - clargs.Add("-a"); - clargs.Add(sid); + if (aids.length() > 0) + aids += ","; + aids += sid; if (t->aac_is_sbr) { cmdline += "--aac-is-sbr " + sid + " "; @@ -576,15 +579,15 @@ void mmg_dialog::update_command_line() { } else if (t->type == 'v') { no_video = false; - cmdline += "-d " + sid + " "; - clargs.Add("-d"); - clargs.Add(sid); + if (dids.length() > 0) + dids += ","; + dids += sid; } else if (t->type == 's') { no_subs = false; - cmdline += "-s " + sid + " "; - clargs.Add("-s"); - clargs.Add(sid); + if (sids.length() > 0) + sids += ","; + sids += sid; if ((t->sub_charset->Length() > 0) && (*t->sub_charset != "default")) { cmdline += "--sub-charset \"" + sid + ":" + @@ -672,6 +675,22 @@ void mmg_dialog::update_command_line() { } + if (aids.length() > 0) { + cmdline += "-a " + aids + " "; + clargs.Add("-a"); + clargs.Add(aids); + } + if (dids.length() > 0) { + cmdline += "-d " + dids + " "; + clargs.Add("-d"); + clargs.Add(dids); + } + if (sids.length() > 0) { + cmdline += "-s " + sids + " "; + clargs.Add("-s"); + clargs.Add(sids); + } + if (tracks_selected_here) { if (f->no_chapters) { cmdline += "--no-chapters ";