projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
39f0c85
)
Stop the Windows version of run_ffprobe manipulating the current working directory...
author
Carl Hetherington
<cth@carlh.net>
Tue, 6 Oct 2020 19:37:46 +0000
(21:37 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 13 Oct 2020 16:51:11 +0000
(18:51 +0200)
src/lib/cross_windows.cc
patch
|
blob
|
history
diff --git
a/src/lib/cross_windows.cc
b/src/lib/cross_windows.cc
index 23a5da5998b41c604a54f48e0215b289e152e6e7..2072ffd4c63ab47ed8cb3fb81e4bccf790eeb64d 100644
(file)
--- a/
src/lib/cross_windows.cc
+++ b/
src/lib/cross_windows.cc
@@
-126,12
+126,8
@@
run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
return;
}
return;
}
- wchar_t previous_dir[512];
- GetCurrentDirectory (sizeof(previous_dir), previous_dir);
-
wchar_t dir[512];
MultiByteToWideChar (CP_UTF8, 0, directory_containing_executable().string().c_str(), -1, dir, sizeof(dir));
wchar_t dir[512];
MultiByteToWideChar (CP_UTF8, 0, directory_containing_executable().string().c_str(), -1, dir, sizeof(dir));
- SetCurrentDirectory (dir);
STARTUPINFO startup_info;
ZeroMemory (&startup_info, sizeof (startup_info));
STARTUPINFO startup_info;
ZeroMemory (&startup_info, sizeof (startup_info));
@@
-150,16
+146,14
@@
run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
PROCESS_INFORMATION process_info;
ZeroMemory (&process_info, sizeof (process_info));
PROCESS_INFORMATION process_info;
ZeroMemory (&process_info, sizeof (process_info));
- if (!CreateProcess (0, command, 0, 0, TRUE, CREATE_NO_WINDOW, 0,
0
, &startup_info, &process_info)) {
+ if (!CreateProcess (0, command, 0, 0, TRUE, CREATE_NO_WINDOW, 0,
dir
, &startup_info, &process_info)) {
LOG_ERROR_NC (N_("ffprobe call failed (could not CreateProcess)"));
LOG_ERROR_NC (N_("ffprobe call failed (could not CreateProcess)"));
- SetCurrentDirectory (previous_dir);
return;
}
FILE* o = fopen_boost (out, "w");
if (!o) {
LOG_ERROR_NC (N_("ffprobe call failed (could not create output file)"));
return;
}
FILE* o = fopen_boost (out, "w");
if (!o) {
LOG_ERROR_NC (N_("ffprobe call failed (could not create output file)"));
- SetCurrentDirectory (previous_dir);
return;
}
return;
}
@@
-180,8
+174,6
@@
run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
CloseHandle (process_info.hProcess);
CloseHandle (process_info.hThread);
CloseHandle (child_stderr_read);
CloseHandle (process_info.hProcess);
CloseHandle (process_info.hThread);
CloseHandle (child_stderr_read);
-
- SetCurrentDirectory (previous_dir);
}
list<pair<string, string> >
}
list<pair<string, string> >