mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
Handle temp paths with spaces.
This commit is contained in:
parent
da6d33e0a7
commit
d5388dfb95
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-13 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
|
* mmg: bug fix: If the TEMP environment variable contains spaces
|
||||||
|
then the calls to mkvmerge when adding files failed.
|
||||||
|
|
||||||
2005-03-06 Moritz Bunkus <moritz@bunkus.org>
|
2005-03-06 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
* mkvmerge: bug fix: Extracting the FPS from some AVC MP4 files
|
* mkvmerge: bug fix: Extracting the FPS from some AVC MP4 files
|
||||||
|
@ -155,8 +155,10 @@ job_run_dialog::start_next_job() {
|
|||||||
mdlg->load(wxString::Format(wxT("%s/jobs/%d.mmg"), wxGetCwd().c_str(),
|
mdlg->load(wxString::Format(wxT("%s/jobs/%d.mmg"), wxGetCwd().c_str(),
|
||||||
jobs[ndx].id));
|
jobs[ndx].id));
|
||||||
|
|
||||||
opt_file_name.Printf(wxT("mmg-mkvmerge-options-%d-%d"),
|
opt_file_name.Printf(wxT("%smmg-mkvmerge-options-%d-%d"),
|
||||||
|
get_temp_dir().c_str(),
|
||||||
(int)wxGetProcessId(), (int)time(NULL));
|
(int)wxGetProcessId(), (int)time(NULL));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
opt_file = new wxFile(opt_file_name, wxFile::write);
|
opt_file = new wxFile(opt_file_name, wxFile::write);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -191,8 +193,8 @@ job_run_dialog::start_next_job() {
|
|||||||
|
|
||||||
process = new wxProcess(this, 1);
|
process = new wxProcess(this, 1);
|
||||||
process->Redirect();
|
process->Redirect();
|
||||||
pid = wxExecute((*arg_list)[0] + wxT(" @") + opt_file_name, wxEXEC_ASYNC,
|
pid = wxExecute((*arg_list)[0] + wxT(" \"@") + opt_file_name + wxT("\""),
|
||||||
process);
|
wxEXEC_ASYNC, process);
|
||||||
out = process->GetInputStream();
|
out = process->GetInputStream();
|
||||||
|
|
||||||
*jobs[ndx].log = wxT("");
|
*jobs[ndx].log = wxT("");
|
||||||
|
@ -144,8 +144,8 @@ mux_dialog::mux_dialog(wxWindow *parent):
|
|||||||
}
|
}
|
||||||
delete opt_file;
|
delete opt_file;
|
||||||
|
|
||||||
pid = wxExecute((*arg_list)[0] + wxT(" @") + opt_file_name, wxEXEC_ASYNC,
|
pid = wxExecute((*arg_list)[0] + wxT(" \"@") + opt_file_name + wxT("\""),
|
||||||
process);
|
wxEXEC_ASYNC, process);
|
||||||
out = process->GetInputStream();
|
out = process->GetInputStream();
|
||||||
|
|
||||||
line = "";
|
line = "";
|
||||||
|
@ -764,7 +764,7 @@ tab_input::add_file(const wxString &file_name,
|
|||||||
wxUCS(strerror(errno)));
|
wxUCS(strerror(errno)));
|
||||||
wxMessageBox(error, wxT("File creation failed"), wxOK | wxCENTER |
|
wxMessageBox(error, wxT("File creation failed"), wxOK | wxCENTER |
|
||||||
wxICON_ERROR);
|
wxICON_ERROR);
|
||||||
throw 0;
|
return;
|
||||||
}
|
}
|
||||||
opt_file->Write(wxT("--output-charset\nUTF-8\n--identify-verbose\n"));
|
opt_file->Write(wxT("--output-charset\nUTF-8\n--identify-verbose\n"));
|
||||||
arg_utf8 = to_utf8(file_name);
|
arg_utf8 = to_utf8(file_name);
|
||||||
@ -772,8 +772,19 @@ tab_input::add_file(const wxString &file_name,
|
|||||||
opt_file->Write(wxT("\n"));
|
opt_file->Write(wxT("\n"));
|
||||||
delete opt_file;
|
delete opt_file;
|
||||||
|
|
||||||
command = wxT("\"") + mkvmerge_path + wxT("\" @") + opt_file_name;
|
command = wxT("\"") + mkvmerge_path + wxT("\" \"@") + opt_file_name +
|
||||||
|
wxT("\"");
|
||||||
|
|
||||||
|
wxLogMessage(wxT("identify 1: command: ``%s''"), command.c_str());
|
||||||
|
|
||||||
result = wxExecute(command, output, errors);
|
result = wxExecute(command, output, errors);
|
||||||
|
|
||||||
|
wxLogMessage(wxT("identify 1: result: %d"), result);
|
||||||
|
for (i = 0; i < output.Count(); i++)
|
||||||
|
wxLogMessage(wxT("identify 1: output[%d]: ``%s''"), i, output[i].c_str());
|
||||||
|
for (i = 0; i < errors.Count(); i++)
|
||||||
|
wxLogMessage(wxT("identify 1: errors[%d]: ``%s''"), i, errors[i].c_str());
|
||||||
|
|
||||||
wxRemoveFile(opt_file_name);
|
wxRemoveFile(opt_file_name);
|
||||||
if ((result < 0) || (result > 1)) {
|
if ((result < 0) || (result > 1)) {
|
||||||
name.Printf(wxT("File identification failed for '%s'. Return code: "
|
name.Printf(wxT("File identification failed for '%s'. Return code: "
|
||||||
|
Loading…
Reference in New Issue
Block a user