summaryrefslogtreecommitdiff
path: root/src/lib/dcp_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-10 13:22:35 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commitcc76b517f6a74f813ae38137bdc88ff3bafa6dd9 (patch)
tree34c2960763f897936efef689898a1f392fb38375 /src/lib/dcp_content.cc
parenta3073b3059e8df6304d2936ab2c605e6908a7373 (diff)
Allow content parts to not be preset in XML.
Diffstat (limited to 'src/lib/dcp_content.cc')
-rw-r--r--src/lib/dcp_content.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 6a6f6efc5..2cd7e576f 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -72,9 +72,10 @@ DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
DCPContent::DCPContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: Content (film, node)
{
- video.reset (new VideoContent (this, film, node, version));
+ video = VideoContent::from_xml (this, film, node, version);
+ audio = AudioContent::from_xml (this, film, node);
+ subtitle = SubtitleContent::from_xml (this, film, node, version);
- audio.reset (new AudioContent (this, film, node));
audio->set_stream (
AudioStreamPtr (
new AudioStream (node->number_child<int> ("AudioFrameRate"), AudioMapping (node->node_child ("AudioMapping"), version))
@@ -83,10 +84,6 @@ DCPContent::DCPContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
_name = node->string_child ("Name");
- if (node->bool_child ("HasSubtitles")) {
- subtitle.reset (new SubtitleContent (this, film, node, version));
- }
-
_encrypted = node->bool_child ("Encrypted");
if (node->optional_node_child ("KDM")) {
_kdm = dcp::EncryptedKDM (node->string_child ("KDM"));
@@ -179,7 +176,6 @@ DCPContent::as_xml (xmlpp::Node* node) const
boost::mutex::scoped_lock lm (_mutex);
node->add_child("Name")->add_child_text (_name);
- node->add_child("HasSubtitles")->add_child_text (subtitle ? "1" : "0");
node->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0");
if (_kdm) {
node->add_child("KDM")->add_child_text (_kdm->as_xml ());