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));
SetCurrentDirectory (dir);
ZeroMemory (&process_info, sizeof (process_info));
if (!CreateProcess (0, command, 0, 0, TRUE, CREATE_NO_WINDOW, 0, 0, &startup_info, &process_info)) {
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)"));
+ SetCurrentDirectory (previous_dir);
return;
}
CloseHandle (process_info.hProcess);
CloseHandle (process_info.hThread);
CloseHandle (child_stderr_read);
+
+ SetCurrentDirectory (previous_dir);
}
list<pair<string, string> >