From fcaab33dee470c02a4988aa4317e14de7d4690c9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 18 Jun 2020 12:53:15 +0200 Subject: [PATCH] Fix save/load of Atmos asset lengths. --- src/lib/atmos_mxf_content.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/atmos_mxf_content.cc b/src/lib/atmos_mxf_content.cc index 581b1b2f0..4c1201c70 100644 --- a/src/lib/atmos_mxf_content.cc +++ b/src/lib/atmos_mxf_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "i18n.h" @@ -43,7 +44,10 @@ AtmosMXFContent::AtmosMXFContent (boost::filesystem::path path) AtmosMXFContent::AtmosMXFContent (cxml::ConstNodePtr node, int) : Content (node) { - + /* This was mistakenly left out for a while, so make sure we at least don't + * crash if an old Film is loaded. + */ + _length = node->optional_number_child("Length").get_value_or(0); } bool @@ -89,6 +93,7 @@ AtmosMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const { node->add_child("Type")->add_child_text ("AtmosMXF"); Content::as_xml (node, with_paths); + node->add_child("Length")->add_child_text(dcp::raw_convert(_length)); } DCPTime -- 2.30.2