diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-07-23 14:26:02 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-07-23 14:26:02 +0100 |
| commit | bf19399f8c009ff211d5c7b45b0941417d963c4e (patch) | |
| tree | 3461fb9045462aec4c01de8d5d34f4a73e755b96 /src/lib/util.cc | |
| parent | f737005941d25e5e5743a6770208f31bdca5527d (diff) | |
Tidy up handling of content-modified checks when using the dcpomatic_cli.
Diffstat (limited to 'src/lib/util.cc')
| -rw-r--r-- | src/lib/util.cc | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index 3b6be6dcc..fee4a3c26 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -949,10 +949,9 @@ emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size bool show_jobs_on_console (bool progress) { - bool should_stop = false; bool first = true; bool error = false; - while (!should_stop) { + while (true) { dcpomatic_sleep (5); @@ -967,9 +966,6 @@ show_jobs_on_console (bool progress) first = false; - int unfinished = 0; - int finished_in_error = 0; - BOOST_FOREACH (shared_ptr<Job> i, jobs) { if (progress) { cout << i->name(); @@ -985,25 +981,20 @@ show_jobs_on_console (bool progress) } } - if (!i->finished ()) { - ++unfinished; - } - - if (i->finished_in_error ()) { - ++finished_in_error; - error = true; - } - - if (!progress && i->finished_in_error ()) { + if (!progress && i->finished_in_error()) { /* We won't see this error if we haven't been showing progress, so show it now. */ cout << i->status() << "\n"; } + + if (i->finished_in_error()) { + error = true; + } } - if (unfinished == 0 || finished_in_error != 0) { - should_stop = true; + if (!JobManager::instance()->work_to_do()) { + break; } } |
