summaryrefslogtreecommitdiff
path: root/src/lib/cross_osx.cc
diff options
context:
space:
mode:
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;
+ }
}