diff options
Diffstat (limited to 'test/test.c')
-rw-r--r-- | test/test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c index 2c728d960..8e58fa9e3 100644 --- a/test/test.c +++ b/test/test.c @@ -260,6 +260,8 @@ static int get_argv_utf8(int *argc_ptr, char ***argv_ptr) #endif } +static volatile int job_running = 0; + void EventLoop(hb_handle_t *h, hb_dict_t *preset_dict) { /* Wait... */ @@ -351,6 +353,7 @@ void EventLoop(hb_handle_t *h, hb_dict_t *preset_dict) HandleEvents( h, preset_dict ); } + job_running = 0; } int RunQueueJob(hb_handle_t *h, hb_dict_t *job_dict) @@ -371,6 +374,7 @@ int RunQueueJob(hb_handle_t *h, hb_dict_t *job_dict) hb_add_json(h, json_job); free(json_job); + job_running = 1; hb_start( h ); EventLoop(h, NULL); @@ -787,6 +791,11 @@ static int HandleEvents(hb_handle_t * h, hb_dict_t *preset_dict) hb_title_set_t * title_set; hb_title_t * title; + if (job_running) + { + // SCANDONE generated by a scan during execution of the job + break; + } title_set = hb_get_title_set( h ); if( !title_set || !hb_list_count( title_set->list_title ) ) { @@ -877,6 +886,7 @@ static int HandleEvents(hb_handle_t * h, hb_dict_t *preset_dict) hb_add_json(h, json_job); free(json_job); + job_running = 1; hb_start( h ); break; } @@ -936,6 +946,7 @@ static int HandleEvents(hb_handle_t * h, hb_dict_t *preset_dict) } done_error = p.error; work_done = 1; + job_running = 0; break; #undef p } |