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 | |
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')
-rw-r--r-- | macosx/HBCore.m | 15 | ||||
-rw-r--r-- | macosx/HBStateFormatter+Private.m | 5 |
2 files changed, 11 insertions, 9 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. diff --git a/macosx/HBStateFormatter+Private.m b/macosx/HBStateFormatter+Private.m index 809617e11..e4728661f 100644 --- a/macosx/HBStateFormatter+Private.m +++ b/macosx/HBStateFormatter+Private.m @@ -41,7 +41,7 @@ [string appendString:@"\n"]; } - if (self.showPassNumber) + if (self.showPassNumber && p.pass_count > -1) { if (p.pass_id == HB_PASS_SUBTITLE) { @@ -77,6 +77,7 @@ break; } +#undef p case HB_STATE_MUXING: { @@ -90,7 +91,6 @@ break; } -#undef p case HB_STATE_SCANNING: { #define p s.param.scanning @@ -124,6 +124,7 @@ switch (s.state) { + case HB_STATE_SEARCHING: case HB_STATE_WORKING: case HB_STATE_PAUSED: #define p s.param.working |