From 9f83160b092bb86e1a0edd8b67144b1195f3d6e0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 15 Oct 2025 09:02:55 +0200 Subject: Fix macOS compile error and try to make display sleep work there. --- src/lib/cross.h | 2 ++ src/lib/cross_osx.cc | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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; + } } -- cgit v1.2.3