summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/cross.h2
-rw-r--r--src/lib/cross_osx.cc10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/cross.h b/src/lib/cross.h
index c304b6dfb..8b1ffccca 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -93,7 +93,9 @@ public:
private:
boost::mutex _mutex;
+#ifdef DCPOMATIC_WINDOWS
Reason _reason;
+#endif
#ifdef DCPOMATIC_OSX
IOPMAssertionID _assertion_id;
#endif
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc
index cda6a643f..acb51283d 100644
--- a/src/lib/cross_osx.cc
+++ b/src/lib/cross_osx.cc
@@ -156,10 +156,16 @@ Waker::nudge()
Waker::Waker(Reason reason)
- : _reason(reason)
{
boost::mutex::scoped_lock lm(_mutex);
- IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("Encoding DCP"), &_assertion_id);
+ switch (reason) {
+ case Reason::ENCODING:
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("Encoding DCP"), &_assertion_id);
+ break;
+ case Reason::PLAYING:
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("Playing DCP"), &_assertion_id);
+ break;
+ }
}