summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-06-18 12:53:15 +0200
committerCarl Hetherington <cth@carlh.net>2020-06-18 12:53:15 +0200
commitfcaab33dee470c02a4988aa4317e14de7d4690c9 (patch)
treebdba28360723a378f3bfee68ccdf1d50fde3b9a9
parentf7b5d2d44fe7cd41f673022bfbd4560987b4902c (diff)
Fix save/load of Atmos asset lengths.
-rw-r--r--src/lib/atmos_mxf_content.cc9
1 files 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 <cth@carlh.net>
+ Copyright (C) 2016-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -25,6 +25,7 @@
#include <asdcp/KM_log.h>
#include <dcp/atmos_asset.h>
#include <dcp/exceptions.h>
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#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<Frame>("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<string>(_length));
}
DCPTime