diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-11-29 23:18:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-11-29 23:33:52 +0100 |
| commit | 052abf06a9fed23f61eaa934ac0e8662bbe142ce (patch) | |
| tree | 22e26493459949116bea1cbae6e6592ee171dc60 | |
| parent | db53687617961f5ae0c68d630472f2d9d927b4d4 (diff) | |
Tidy-up/fix Atmos frame rate checks.
| -rw-r--r-- | src/lib/film.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index b624b234b..5b845d8b4 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1616,21 +1616,24 @@ Film::playlist_change (ChangeType type) void Film::check_settings_consistency () { - optional<int> atmos_rate; + std::set<int> atmos_rates; for (auto i: content()) { - if (i->atmos) { - int rate = lrintf (i->atmos->edit_rate().as_float()); - if (atmos_rate && *atmos_rate != rate) { - Message (_("You have more than one piece of Atmos content, and they do not have the same frame rate. You must remove some Atmos content.")); - } else if (!atmos_rate && rate != video_frame_rate()) { - atmos_rate = rate; - set_video_frame_rate (rate, false); - Message(variant::insert_dcpomatic(_("%1 had to change your settings so that the film's frame rate is the same as that of your Atmos content."))); - } + atmos_rates.insert(lrintf(i->atmos->edit_rate().as_float())); } } + if (atmos_rates.size() > 1) { + Message(_("You have more than one piece of Atmos content, and they do not have the same frame rate. You must remove some Atmos content.")); + } else if (atmos_rates.size() == 1 && *atmos_rates.begin() != video_frame_rate()) { + set_video_frame_rate(*atmos_rates.begin(), false); + Message(variant::insert_dcpomatic(_("%1 had to change your settings so that the film's frame rate is the same as that of your Atmos content."))); + } + + if (!atmos_rates.empty()) { + check_reel_boundaries_for_atmos(); + } + bool change_made = false; for (auto i: content()) { auto d = dynamic_pointer_cast<DCPContent>(i); |
