Build fixes for Boost >= 1.73
[dcpomatic.git] / src / wx / subtitle_appearance_dialog.cc
index 339388be6e14e0eb25141f2efc8a49ea358599f3..45498c464c7eefdbc3a5f37adcc4ae611b71ff6a 100644 (file)
@@ -40,6 +40,9 @@ using boost::shared_ptr;
 using boost::bind;
 using boost::dynamic_pointer_cast;
 using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 int const SubtitleAppearanceDialog::NONE = 0;
 int const SubtitleAppearanceDialog::OUTLINE = 1;
@@ -58,7 +61,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
                /* XXX: assuming that all FFmpeg streams have bitmap subs */
                if (_stream->colours().empty()) {
                        _job_manager_connection = JobManager::instance()->ActiveJobsChanged.connect(boost::bind(&SubtitleAppearanceDialog::active_jobs_changed, this, _1));
-                       JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
+                       _job = JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
                }
        }
 
@@ -107,7 +110,10 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
                t->SetLabelMarkup (_("<b>New colour</b>"));
                _colour_table->Add (t, 1, wxALIGN_CENTER);
 
-               add_colours ();
+               shared_ptr<Job> job = _job.lock ();
+               if (!job || job->finished()) {
+                       add_colours ();
+               }
 
                _colours_panel->SetSizer (_colour_table);