diff options
author | Damiano Galassi <[email protected]> | 2017-03-15 18:10:02 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-03-15 18:10:02 +0100 |
commit | 1f54807178d50df83d9643e8ca05370f1b7f73a5 (patch) | |
tree | 5e27a7e8fd91196f529ddf780ebe61c744a29ebf /libhb/ports.c | |
parent | 8c7e64977d1fcfcd876999cc9022fdc05d910b92 (diff) |
libhb: initialize sleep prevention reasonForActivity CFStringRef inside a function, fix build with icc mac compiler. Patch by jwardnh.
Diffstat (limited to 'libhb/ports.c')
-rw-r--r-- | libhb/ports.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libhb/ports.c b/libhb/ports.c index afc5c59c9..a483ed9bc 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -1267,12 +1267,6 @@ void hb_net_close( hb_net_t ** _n ) * OS Sleep Allow / Prevent ***********************************************************************/ -#ifdef __APPLE__ -// 128 chars limit for IOPMAssertionCreateWithName -static CFStringRef reasonForActivity = - CFSTR("HandBrake is currently scanning and/or encoding"); -#endif - void* hb_system_sleep_opaque_init() { void *opaque = NULL; @@ -1351,6 +1345,10 @@ void hb_system_sleep_private_disable(void *opaque) return; } + // 128 chars limit for IOPMAssertionCreateWithName + CFStringRef reasonForActivity = + CFSTR("HandBrake is currently scanning and/or encoding"); + IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertPreventUserIdleSystemSleep, kIOPMAssertionLevelOn, reasonForActivity, |