summaryrefslogtreecommitdiff
path: root/src/lib/spl_entry.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-06-21 11:57:24 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 23:13:14 +0200
commit9db2168dcc14a803dcd9da047ddd70e2142d82e2 (patch)
tree452103b2ed3a65cbaf9f3b4bb731c2afdbd809f7 /src/lib/spl_entry.cc
parentd1c151cfdedbf1946d30e9072dc4a5b2ea5f2f80 (diff)
Allow specification of player crop in playlist.
Diffstat (limited to 'src/lib/spl_entry.cc')
-rw-r--r--src/lib/spl_entry.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/spl_entry.cc b/src/lib/spl_entry.cc
index 03df91729..2fc179841 100644
--- a/src/lib/spl_entry.cc
+++ b/src/lib/spl_entry.cc
@@ -23,6 +23,7 @@
#include "dcpomatic_assert.h"
#include "spl_entry.h"
#include <dcp/warnings.h>
+#include <fmt/format.h>
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
@@ -32,7 +33,7 @@ using std::dynamic_pointer_cast;
using std::shared_ptr;
-SPLEntry::SPLEntry(shared_ptr<Content> c)
+SPLEntry::SPLEntry(shared_ptr<Content> c, cxml::ConstNodePtr node)
: content(c)
, digest(content->digest())
{
@@ -46,6 +47,12 @@ SPLEntry::SPLEntry(shared_ptr<Content> c)
name = content->path(0).filename().string();
kind = dcp::ContentKind::FEATURE;
}
+
+ if (node) {
+ if (auto crop = node->optional_number_child<float>("CropToRatio")) {
+ crop_to_ratio = *crop;
+ }
+ }
}
@@ -57,4 +64,7 @@ SPLEntry::as_xml(xmlpp::Element* e)
} else {
cxml::add_text_child(e, "Digest", digest);
}
+ if (crop_to_ratio) {
+ cxml::add_text_child(e, "CropToRatio", fmt::to_string(*crop_to_ratio));
+ }
}