summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-03-18 18:07:48 +0000
committerRodeo <[email protected]>2013-03-18 18:07:48 +0000
commit30ddd53e26b3e2aa5930c6cf985f938e36985aed (patch)
tree3399efbb5727360437672b8918a32dab72420e22 /macosx
parentb0aa37a7ff20acafe7a28fe67c69699515d963c5 (diff)
hb_system_sleep: refactoring.
Also: - release power assertions before freeing them - actually free the power assertions in hb_close() (previously unused) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5340 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/Controller.m18
-rw-r--r--macosx/HBPreviewController.m6
2 files changed, 12 insertions, 12 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index c8a064fb2..8635ea14f 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -2027,7 +2027,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
[self writeToActivityLog: "scanning titles with a duration of %d seconds or more", min_title_duration_seconds];
}
- hb_prevent_sleep(fHandle);
+ hb_system_sleep_prevent(fHandle);
hb_scan(fHandle, [path UTF8String], scanTitleNum, hb_num_previews, 1 ,
min_title_duration_ticks);
@@ -2042,7 +2042,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
- (IBAction) cancelScanning:(id)sender
{
hb_scan_stop(fHandle);
- hb_allow_sleep(fHandle);
+ hb_system_sleep_allow(fHandle);
}
- (IBAction) showNewScan:(id)sender
@@ -2208,7 +2208,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
}
/* Done scanning, allow system sleep for the scan handle */
- hb_allow_sleep(fHandle);
+ hb_system_sleep_allow(fHandle);
}
@@ -2821,7 +2821,7 @@ fWorkingCount = 0;
{
[self writeToActivityLog: "incrementQueueItemDone there are no more pending encodes"];
/* Done encoding, allow system sleep for the encode handle */
- hb_allow_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_allow(fQueueEncodeLibhb);
/*
* Since there are no more items to encode, go to queueCompletedAlerts
* for user specified alerts after queue completed
@@ -2869,7 +2869,7 @@ fWorkingCount = 0;
* only useful for autocrop and static previews, which are already taken
* care of at this point
*/
- hb_prevent_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_prevent(fQueueEncodeLibhb);
hb_scan(fQueueEncodeLibhb, [path UTF8String], scanTitleNum, 10, 0, 0);
}
}
@@ -4541,7 +4541,7 @@ bool one_burned = FALSE;
hb_stop(fQueueEncodeLibhb);
- hb_allow_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_allow(fQueueEncodeLibhb);
// Delete all remaining jobs since libhb doesn't do this on its own.
hb_job_t * job;
@@ -4583,7 +4583,7 @@ bool one_burned = FALSE;
- (void) doCancelCurrentJobAndStop
{
hb_stop(fQueueEncodeLibhb);
- hb_allow_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_allow(fQueueEncodeLibhb);
// Delete all remaining jobs since libhb doesn't do this on its own.
hb_job_t * job;
@@ -4609,13 +4609,13 @@ bool one_burned = FALSE;
if (s.state == HB_STATE_PAUSED)
{
- hb_prevent_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_prevent(fQueueEncodeLibhb);
hb_resume(fQueueEncodeLibhb);
}
else
{
hb_pause(fQueueEncodeLibhb);
- hb_allow_sleep(fQueueEncodeLibhb);
+ hb_system_sleep_allow(fQueueEncodeLibhb);
}
}
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m
index 4ef2824e3..5214cf0ea 100644
--- a/macosx/HBPreviewController.m
+++ b/macosx/HBPreviewController.m
@@ -687,7 +687,7 @@
{
fEncodeState = 2;
hb_stop(fPreviewLibhb);
- hb_allow_sleep(fPreviewLibhb);
+ hb_system_sleep_allow(fPreviewLibhb);
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:0.2];
[[fEncodingControlBox animator] setHidden:YES];
@@ -805,7 +805,7 @@
/* Let fPreviewLibhb do the job */
fEncodeState = 1;
- hb_prevent_sleep(fPreviewLibhb);
+ hb_system_sleep_prevent(fPreviewLibhb);
hb_start(fPreviewLibhb);
}
@@ -900,7 +900,7 @@
fEncodeState = 0;
/* Done encoding, allow system sleep for the preview handle */
- hb_allow_sleep(fPreviewLibhb);
+ hb_system_sleep_allow(fPreviewLibhb);
break;
}
}