summaryrefslogtreecommitdiff
path: root/src/lib/cross_osx.cc
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 /src/lib/cross_osx.cc
parent45923ef4c7bbd0454c58887770c437e1f2232e31 (diff)
Fix macOS compile error and try to make display sleep work there.
Diffstat (limited to 'src/lib/cross_osx.cc')
-rw-r--r--src/lib/cross_osx.cc10
1 files changed, 8 insertions, 2 deletions
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;
+ }
}