summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-15 09:02:55 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-15 09:02:55 +0200
commit9f83160b092bb86e1a0edd8b67144b1195f3d6e0 (patch)
treef47f1109c6d562ee50c3ea297b70669bb5f0ed3b
parent45923ef4c7bbd0454c58887770c437e1f2232e31 (diff)
Fix macOS compile error and try to make display sleep work there.
-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;
+ }
}