diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-11 00:10:22 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-12-16 02:07:37 +0100 |
| commit | 5bfdb7e6c422dfc2f8c9124d4249633933a0b063 (patch) | |
| tree | bf712c49cb2fc6dda8b93e50da28d8935f4b7ebf /src/lib/film.cc | |
| parent | d828617ab8613d432c1796991e8e23118e32df34 (diff) | |
Normalise XML attribute names to be camelCase (#2241).
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index a5b393cc1..eb1943ffb 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -416,7 +416,7 @@ Film::metadata (bool with_content_paths) const root->add_child("UserExplicitVideoFrameRate")->add_child_text(_user_explicit_video_frame_rate ? "1" : "0"); for (auto const& marker: _markers) { auto m = root->add_child("Marker"); - m->set_attribute("Type", dcp::marker_to_string(marker.first)); + m->set_attribute("type", dcp::marker_to_string(marker.first)); m->add_child_text(raw_convert<string>(marker.second.get())); } for (auto i: _ratings) { @@ -602,7 +602,11 @@ Film::read_metadata (optional<boost::filesystem::path> path) _user_explicit_video_frame_rate = f.optional_bool_child("UserExplicitVideoFrameRate").get_value_or(false); for (auto i: f.node_children("Marker")) { - _markers[dcp::marker_from_string(i->string_attribute("Type"))] = DCPTime(dcp::raw_convert<DCPTime::Type>(i->content())); + auto type = i->optional_string_attribute("Type"); + if (!type) { + type = i->string_attribute("type"); + } + _markers[dcp::marker_from_string(*type)] = DCPTime(dcp::raw_convert<DCPTime::Type>(i->content())); } for (auto i: f.node_children("Rating")) { |
