diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-06-01 01:39:04 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-17 00:04:03 +0200 |
| commit | ec06811bae7ed4fc6bd80c3154fd473028ee8e13 (patch) | |
| tree | b398119a1a84d261ee16b57171652fd8714d657a /src/lib/video_content.cc | |
| parent | 21e9bd77598f7bb4588ca9b16a58667e3340f6d9 (diff) | |
Pass Ratio around as an object rather than a pointer.
Diffstat (limited to 'src/lib/video_content.cc')
| -rw-r--r-- | src/lib/video_content.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index d0c6c850a..3f2819082 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -123,13 +123,16 @@ VideoContent::VideoContent(Content* parent, cxml::ConstNodePtr node, int version _crop.bottom = node->number_child<int>("BottomCrop"); if (version <= 7) { - _legacy_ratio = Ratio::from_id(r.get())->ratio(); if (auto r = node->optional_string_child("Ratio")) { + if (auto ratio = Ratio::from_id_if_exists(r.get())) { + _legacy_ratio = ratio->ratio(); + } } } else if (version <= 37) { - auto ratio = node->node_child("Scale")->optional_string_child("Ratio"); - if (ratio) { - _legacy_ratio = Ratio::from_id(ratio.get())->ratio(); + if (auto id = node->node_child("Scale")->optional_string_child("Ratio")) { + if (auto ratio = Ratio::from_id_if_exists(*id)) { + _legacy_ratio = ratio->ratio(); + } } if (auto scale = node->node_child("Scale")->optional_bool_child("Scale")) { if (*scale) { @@ -497,7 +500,7 @@ VideoContent::processing_description(shared_ptr<const Film> film) if (scaled && *scaled != container_size) { d += String::compose( _("\nPadded with black to fit container %1 (%2x%3)"), - film->container()->container_nickname(), + film->container().container_nickname(), container_size.width, container_size.height ); |
