diff options
author | Damiano Galassi <[email protected]> | 2016-12-20 12:17:42 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2016-12-20 12:17:42 +0100 |
commit | 239209172c2db0e9ed81aea492d914ac53bc6c5e (patch) | |
tree | 21551eb67154386827610ac2faf656cb3f12d498 /macosx/HBCore.m | |
parent | 3586396665f8eb52d3ac3dcf8b315c98d756bf4a (diff) |
MacGui: do not display pass info if pass_count is -1. Start the HBCore update timer only after starting a scan/job.
Diffstat (limited to 'macosx/HBCore.m')
-rw-r--r-- | macosx/HBCore.m | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/macosx/HBCore.m b/macosx/HBCore.m index a0f3e5811..645934565 100644 --- a/macosx/HBCore.m +++ b/macosx/HBCore.m @@ -97,7 +97,8 @@ static void hb_error_handler(const char *errmsg) _titles = @[]; _stateFormatter = [[HBStateFormatter alloc] init]; - _hb_state = malloc(sizeof(struct hb_state_s)); + _hb_state = malloc(sizeof(hb_state_t)); + bzero(_hb_state, sizeof(hb_state_t)); _logLevel = level; _hb_handle = hb_init(level); @@ -204,9 +205,6 @@ static void hb_error_handler(const char *errmsg) self.progressHandler = progressHandler; self.completionHandler = completionHandler; - // Start the timer to handle libhb state changes - [self startUpdateTimerWithInterval:0.2]; - NSString *path = url.path; HBDVDDetector *detector = [HBDVDDetector detectorForPath:path]; @@ -239,6 +237,9 @@ static void hb_error_handler(const char *errmsg) (int)index, (int)previewsNum, 1, min_title_duration_ticks); + // Start the timer to handle libhb state changes + [self startUpdateTimerWithInterval:0.2]; + // Set the state, so the UI can be update // to reflect the current state instead of // waiting for libhb to set it in a background thread. @@ -454,9 +455,6 @@ static void hb_error_handler(const char *errmsg) self.progressHandler = progressHandler; self.completionHandler = completionHandler; - // Start the timer to handle libhb state changes - [self startUpdateTimerWithInterval:0.5]; - // Add the job to libhb hb_job_t *hb_job = job.hb_job; hb_job_set_file(hb_job, job.destURL.path.fileSystemRepresentation); @@ -468,6 +466,9 @@ static void hb_error_handler(const char *errmsg) hb_system_sleep_prevent(_hb_handle); hb_start(_hb_handle); + // Start the timer to handle libhb state changes + [self startUpdateTimerWithInterval:0.5]; + // Set the state, so the UI can be update // to reflect the current state instead of // waiting for libhb to set it in a background thread. |