#include "cross.h"
#include "compose.hpp"
#include "log.h"
-#ifdef DVDOMATIC_POSIX
+#ifdef DCPOMATIC_LINUX
#include <unistd.h>
+#include <mntent.h>
#endif
-#ifdef DVDOMATIC_WINDOWS
+#ifdef DCPOMATIC_WINDOWS
#include <windows.h>
#undef DATADIR
#include <shlwapi.h>
#endif
-#ifdef DVDOMATIC_OSX
+#ifdef DCPOMATIC_OSX
#include <sys/sysctl.h>
#endif
using std::pair;
+using std::list;
using std::ifstream;
using std::string;
+using std::make_pair;
using boost::shared_ptr;
void
-dvdomatic_sleep (int s)
+dcpomatic_sleep (int s)
{
-#ifdef DVDOMATIC_POSIX
+#ifdef DCPOMATIC_POSIX
sleep (s);
#endif
-#ifdef DVDOMATIC_WINDOWS
+#ifdef DCPOMATIC_WINDOWS
Sleep (s * 1000);
#endif
}
pair<string, int> info;
info.second = 0;
-#ifdef DVDOMATIC_LINUX
+#ifdef DCPOMATIC_LINUX
ifstream f ("/proc/cpuinfo");
while (f.good ()) {
string l;
}
#endif
-#ifdef DVDOMATIC_OSX
+#ifdef DCPOMATIC_OSX
size_t N = sizeof (info.second);
sysctlbyname ("hw.ncpu", &info.second, &N, 0, 0);
char buffer[64];
void
run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, shared_ptr<Log> log)
{
-#ifdef DVDOMATIC_WINDOWS
+#ifdef DCPOMATIC_WINDOWS
SECURITY_ATTRIBUTES security;
security.nLength = sizeof (security);
security.bInheritHandle = TRUE;
startup_info.dwFlags |= STARTF_USESTDHANDLES;
wchar_t command[512];
- wcscpy (command, L"ffprobe.exe ");
+ wcscpy (command, L"ffprobe.exe \"");
wchar_t file[512];
MultiByteToWideChar (CP_UTF8, 0, content.string().c_str(), -1, file, sizeof(file));
wcscat (command, file);
+ wcscat (command, L"\"");
+
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)) {
system (ffprobe.c_str ());
#endif
}
+
+list<pair<string, string> >
+mount_info ()
+{
+ list<pair<string, string> > m;
+
+#ifdef DCPOMATIC_LINUX
+ FILE* f = setmntent ("/etc/mtab", "r");
+ if (!f) {
+ return m;
+ }
+
+ while (1) {
+ struct mntent* mnt = getmntent (f);
+ if (!mnt) {
+ break;
+ }
+
+ m.push_back (make_pair (mnt->mnt_dir, mnt->mnt_type));
+ }
+
+ endmntent (f);
+#endif
+
+ return m;
+}