diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-11-04 21:03:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-11-09 20:16:15 +0100 |
| commit | 35dfc1d705561fc41737a076b92fbb03a432b38d (patch) | |
| tree | 0c16c7696c069c641e7faeed372caa0640550ed9 /src | |
| parent | c49bd081b3b06f9c036b63af6f2ffe05db059134 (diff) | |
Re-examine files created before we stopped auto-generating stream IDs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/check_content_job.cc | 14 | ||||
| -rw-r--r-- | src/lib/film.cc | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/lib/check_content_job.cc b/src/lib/check_content_job.cc index 1d3bec659..98e8c7989 100644 --- a/src/lib/check_content_job.cc +++ b/src/lib/check_content_job.cc @@ -24,6 +24,7 @@ #include "dcp_content.h" #include "examine_content_job.h" #include "film.h" +#include "ffmpeg_content.h" #include "job_manager.h" #include "string_text_file_content.h" #include <iostream> @@ -67,8 +68,6 @@ CheckContentJob::run() set_progress_unknown(); auto content = _film->content(); - std::vector<shared_ptr<Content>> changed; - std::copy_if(content.begin(), content.end(), std::back_inserter(changed), [](shared_ptr<Content> c) { return c->changed(); }); if (_film->last_written_by_earlier_than(2, 17, 17)) { for (auto c: content) { @@ -80,11 +79,22 @@ CheckContentJob::run() } } + std::vector<shared_ptr<Content>> changed; + std::copy_if(content.begin(), content.end(), std::back_inserter(changed), [](shared_ptr<Content> c) { return c->changed(); }); if (!changed.empty()) { JobManager::instance()->add(make_shared<ExamineContentJob>(_film, changed, false)); set_message(_("Some files have been changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings.")); } + if (_film->last_written_by_earlier_than(2, 18, 30)) { + std::vector<shared_ptr<Content>> needs_upgrade; + std::copy_if(content.begin(), content.end(), std::back_inserter(needs_upgrade), [](shared_ptr<Content> c) { return static_cast<bool>(dynamic_pointer_cast<FFmpegContent>(c)); }); + if (!needs_upgrade.empty()) { + JobManager::instance()->add(make_shared<ExamineContentJob>(_film, needs_upgrade, false)); + set_message(_("Some files must be re-examined due to a bug fix in DCP-o-matic. You may need to check their settings.")); + } + } + set_progress(1); set_state(FINISHED_OK); } diff --git a/src/lib/film.cc b/src/lib/film.cc index b8f983add..5e46d8615 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -762,6 +762,20 @@ Film::read_metadata(optional<boost::filesystem::path> path) } set_dirty(false); + + /* Clear out possibly-invalid stream IDs (that were created by auto-numbering in previous versions + * which doesn't happen in this one). The content will be re-examined after the film is loaded. + * Before 2.18.26 we wrote IDs which might now fail. In 2.18.30 we added this check, to mistrust + * any existing IDs and to re-create them. + */ + if (last_written_by_earlier_than(2, 18, 30)) { + for (auto content: _playlist->content()) { + if (auto ffmpeg = dynamic_pointer_cast<FFmpegContent>(content)) { + ffmpeg->remove_stream_ids(); + } + } + } + return notes; } |
