Try to prevent windows machines going to sleep during encodes.
authorCarl Hetherington <cth@carlh.net>
Tue, 28 Jan 2014 11:24:53 +0000 (11:24 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 28 Jan 2014 11:24:53 +0000 (11:24 +0000)
ChangeLog
src/lib/cross.cc
src/lib/cross.h
src/lib/encoder.cc

index 429a3f0272bb3e32055b4a7474f46e5e07c79865..e5398c26f1b5f3c3b617b7991acb62558545d623 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-28  Carl Hetherington  <cth@carlh.net>
+
+       * Try to prevent Windows machines going to sleep during encodes.
+
 2014-01-26  Carl Hetherington  <cth@carlh.net>
 
        * Change default JPEG2000 bandwith to 100MBps.
index 57b3f93b24d9dde847ff6fa123539526d6d259bb..9f7a761248aef9f045ba85a14e05356a066b5a4b 100644 (file)
@@ -298,3 +298,11 @@ dcpomatic_fseek (FILE* stream, int64_t offset, int whence)
        return fseek (stream, offset, whence);
 #endif 
 }
+
+void
+kick ()
+{
+#ifdef DCPOMATIC_WINDOWS
+       SetThreadExecutionState (ES_CONTINUOUS);
+#endif 
+}
index 7e032e5a1c808006e0c35860f9be6522f358bc9b..822b36631d604343a94c5b5a03f48b75d8aa31cf 100644 (file)
@@ -35,3 +35,4 @@ extern boost::filesystem::path app_contents ();
 #endif
 extern FILE * fopen_boost (boost::filesystem::path, std::string);
 extern int dcpomatic_fseek (FILE *, int64_t, int);
+void kick ();
index fbec3e4d0d0e65c2a4dfa51653e0461d18873777..92b4763be5768f5ca04c5f40621191d6ef52cb4b 100644 (file)
@@ -180,6 +180,8 @@ Encoder::frame_done ()
 void
 Encoder::process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversion conversion, bool same)
 {
+       kick ();
+       
        boost::mutex::scoped_lock lock (_mutex);
 
        /* XXX: discard 3D here if required */