Try to prevent windows machines going to sleep during encodes.
[dcpomatic.git] / src / lib / cross.cc
index 7436dbf26a9b4582edcfb8e1702638b2e91d3416..9f7a761248aef9f045ba85a14e05356a066b5a4b 100644 (file)
@@ -187,7 +187,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
                return;
        }
 
-       FILE* o = fopen (out.string().c_str(), "w");
+       FILE* o = fopen_boost (out, "w");
        if (!o) {
                log->log ("ffprobe call failed (could not create output file)");
                return;
@@ -288,3 +288,21 @@ fopen_boost (boost::filesystem::path p, string t)
         return fopen (p.c_str(), t.c_str ());
 #endif
 }
+
+int
+dcpomatic_fseek (FILE* stream, int64_t offset, int whence)
+{
+#ifdef DCPOMATIC_WINDOWS
+       return _fseeki64 (stream, offset, whence);
+#else  
+       return fseek (stream, offset, whence);
+#endif 
+}
+
+void
+kick ()
+{
+#ifdef DCPOMATIC_WINDOWS
+       SetThreadExecutionState (ES_CONTINUOUS);
+#endif 
+}