X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fdcp_content.cc;h=66f5331b0decb567b86afb129fd36d485fb8e1bb;hp=4280ad13aa7474b698a5255c3e2e635216d15ba2;hb=febe9c38dcc26859ff61a084fa4a6f98897018f1;hpb=5f3a88d3ab1e9c1a13d7e61fc37a0c4cef8df9a5 diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 4280ad13a..66f5331b0 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -18,6 +18,7 @@ */ +#include "atmos_content.h" #include "dcp_content.h" #include "video_content.h" #include "audio_content.h" @@ -91,6 +92,7 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version) video = VideoContent::from_xml (this, node, version); audio = AudioContent::from_xml (this, node, version); text = TextContent::from_xml (this, node, version); + atmos = AtmosContent::from_xml (this, node); for (int i = 0; i < TEXT_COUNT; ++i) { _reference_text[i] = false; @@ -233,6 +235,15 @@ DCPContent::examine (shared_ptr film, shared_ptr job) as->set_mapping (m); } + if (examiner->has_atmos()) { + { + boost::mutex::scoped_lock lm (_mutex); + atmos.reset (new AtmosContent(this)); + } + atmos->set_length (examiner->atmos_length()); + atmos->set_edit_rate (examiner->atmos_edit_rate()); + } + int texts = 0; { boost::mutex::scoped_lock lm (_mutex); @@ -322,6 +333,10 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const i->as_xml (node); } + if (atmos) { + atmos->as_xml (node); + } + boost::mutex::scoped_lock lm (_mutex); node->add_child("Name")->add_child_text (_name); node->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0"); @@ -610,7 +625,7 @@ DCPContent::can_reference (shared_ptr film, function c) { - return static_cast(c->video); + return static_cast(c->video) && c->video->use(); } bool @@ -643,7 +658,7 @@ DCPContent::can_reference_video (shared_ptr film, string& why_not) c static bool check_audio (shared_ptr c) { - return static_cast(c->audio); + return static_cast(c->audio) && !c->audio->mapping().mapped_output_channels().empty(); } bool