Skip to content

Commit

Permalink
libhb: initialize sleep prevention reasonForActivity CFStringRef insi…
Browse files Browse the repository at this point in the history
…de a function, fix build with icc mac compiler. Patch by jwardnh.
  • Loading branch information
galad87 committed Mar 15, 2017
1 parent 8c7e649 commit 1f54807
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions libhb/ports.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1f54807

Please sign in to comment.