Stop the Windows version of run_ffprobe manipulating the current working directory...
[dcpomatic.git] / src / lib / cross_windows.cc
index 272467bd3aee35af4b7293b00f3c73d87b86e05f..2072ffd4c63ab47ed8cb3fb81e4bccf790eeb64d 100644 (file)
@@ -128,7 +128,6 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 
        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));
@@ -147,7 +146,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 
        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)"));
                return;
        }
@@ -193,7 +192,7 @@ directory_containing_executable ()
 
 
 boost::filesystem::path
-shared_path ()
+resources_path ()
 {
        return directory_containing_executable().parent_path();
 }
@@ -206,6 +205,13 @@ xsd_path ()
 }
 
 
+boost::filesystem::path
+tags_path ()
+{
+       return directory_containing_executable().parent_path() / "tags";
+}
+
+
 boost::filesystem::path
 openssl_path ()
 {