summaryrefslogtreecommitdiff
path: root/src/lib/film.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-11-04 21:03:36 +0100
committerCarl Hetherington <cth@carlh.net>2025-11-09 20:16:15 +0100
commit35dfc1d705561fc41737a076b92fbb03a432b38d (patch)
tree0c16c7696c069c641e7faeed372caa0640550ed9 /src/lib/film.cc
parentc49bd081b3b06f9c036b63af6f2ffe05db059134 (diff)
Re-examine files created before we stopped auto-generating stream IDs.
Diffstat (limited to 'src/lib/film.cc')
-rw-r--r--src/lib/film.cc14
1 files changed, 14 insertions, 0 deletions
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;
}