projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be48763
)
Fixes for new libdcp with multiple content versions.
author
Carl Hetherington
<cth@carlh.net>
Sun, 27 Sep 2020 19:18:51 +0000
(21:18 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 27 Sep 2020 19:18:51 +0000
(21:18 +0200)
src/lib/copy_dcp_details_to_film.cc
patch
|
blob
|
history
src/lib/dcp_content.cc
patch
|
blob
|
history
src/lib/dcp_content.h
patch
|
blob
|
history
src/lib/dcp_examiner.cc
patch
|
blob
|
history
src/lib/dcp_examiner.h
patch
|
blob
|
history
test/import_dcp_test.cc
patch
|
blob
|
history
diff --git
a/src/lib/copy_dcp_details_to_film.cc
b/src/lib/copy_dcp_details_to_film.cc
index d73ee8792a96f502a4ba09e6cf58ec1f55ef973a..c33b0974baf536c59c78b1526c68d325a628a65d 100644
(file)
--- a/
src/lib/copy_dcp_details_to_film.cc
+++ b/
src/lib/copy_dcp_details_to_film.cc
@@
-70,10
+70,6
@@
copy_dcp_details_to_film (shared_ptr<const DCPContent> dcp, shared_ptr<Film> fil
}
film->set_ratings (dcp->ratings());
}
film->set_ratings (dcp->ratings());
-
- vector<string> cv;
- cv.push_back (dcp->content_version());
- film->set_content_versions (cv);
+ film->set_content_versions (dcp->content_versions());
}
}
-
diff --git
a/src/lib/dcp_content.cc
b/src/lib/dcp_content.cc
index 00ffb390c2c501970e71f20eb6de4cf90493b4c0..0bef73f77d48cf1ce2e40b217af5bd206db07d28 100644
(file)
--- a/
src/lib/dcp_content.cc
+++ b/
src/lib/dcp_content.cc
@@
-158,7
+158,9
@@
DCPContent::DCPContent (cxml::ConstNodePtr node, int version)
_ratings.push_back (dcp::Rating(i));
}
_ratings.push_back (dcp::Rating(i));
}
- _content_version = node->optional_string_child("ContentVersion").get_value_or("");
+ BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("ContentVersion")) {
+ _content_versions.push_back (i->content());
+ }
}
void
}
void
@@
-274,7
+276,7
@@
DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
_markers[i->first] = ContentTime(i->second.as_editable_units(DCPTime::HZ));
}
_ratings = examiner->ratings ();
_markers[i->first] = ContentTime(i->second.as_editable_units(DCPTime::HZ));
}
_ratings = examiner->ratings ();
- _content_version
= examiner->content_version
();
+ _content_version
s = examiner->content_versions
();
}
if (old_texts == texts) {
}
if (old_texts == texts) {
@@
-390,7
+392,9
@@
DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
i.as_xml (rating);
}
i.as_xml (rating);
}
- node->add_child("ContentVersion")->add_child_text (_content_version);
+ BOOST_FOREACH (string i, _content_versions) {
+ node->add_child("ContentVersion")->add_child_text(i);
+ }
}
DCPTime
}
DCPTime
diff --git
a/src/lib/dcp_content.h
b/src/lib/dcp_content.h
index 6d707670f27eb6bc267d98cefe7bbcd487cdc31f..e8532ff57e70972c707c9eec0999df0853c7a40d 100644
(file)
--- a/
src/lib/dcp_content.h
+++ b/
src/lib/dcp_content.h
@@
-162,8
+162,8
@@
public:
return _ratings;
}
return _ratings;
}
- std::
string content_version
() const {
- return _content_version;
+ std::
vector<std::string> content_versions
() const {
+ return _content_version
s
;
}
private:
}
private:
@@
-214,7
+214,7
@@
private:
std::list<int64_t> _reel_lengths;
std::map<dcp::Marker, dcpomatic::ContentTime> _markers;
std::vector<dcp::Rating> _ratings;
std::list<int64_t> _reel_lengths;
std::map<dcp::Marker, dcpomatic::ContentTime> _markers;
std::vector<dcp::Rating> _ratings;
- std::
string _content_version
;
+ std::
vector<std::string> _content_versions
;
};
#endif
};
#endif
diff --git
a/src/lib/dcp_examiner.cc
b/src/lib/dcp_examiner.cc
index 65cfb884ed8d39911f519b5d196c700a1c3cdae1..27eb74a5d5231e559cc5856ff78040d105e8c786 100644
(file)
--- a/
src/lib/dcp_examiner.cc
+++ b/
src/lib/dcp_examiner.cc
@@
-260,7
+260,9
@@
DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
_three_d = !cpl->reels().empty() && cpl->reels().front()->main_picture() &&
dynamic_pointer_cast<dcp::StereoPictureAsset> (cpl->reels().front()->main_picture()->asset());
_ratings = cpl->ratings();
_three_d = !cpl->reels().empty() && cpl->reels().front()->main_picture() &&
dynamic_pointer_cast<dcp::StereoPictureAsset> (cpl->reels().front()->main_picture()->asset());
_ratings = cpl->ratings();
- _content_version = cpl->content_version().label_text;
+ BOOST_FOREACH (dcp::ContentVersion i, cpl->content_versions()) {
+ _content_versions.push_back (i.label_text);
+ }
_cpl = cpl->id ();
}
_cpl = cpl->id ();
}
diff --git
a/src/lib/dcp_examiner.h
b/src/lib/dcp_examiner.h
index cb68aa523c5235cd726361e40b47c793c763ff1f..232d7f0d87ec2ceebade13de4422530af191c145 100644
(file)
--- a/
src/lib/dcp_examiner.h
+++ b/
src/lib/dcp_examiner.h
@@
-134,8
+134,8
@@
public:
return _ratings;
}
return _ratings;
}
- std::
string content_version
() const {
- return _content_version;
+ std::
vector<std::string> content_versions
() const {
+ return _content_version
s
;
}
bool has_atmos () const {
}
bool has_atmos () const {
@@
-176,7
+176,7
@@
private:
std::list<int64_t> _reel_lengths;
std::map<dcp::Marker, dcp::Time> _markers;
std::vector<dcp::Rating> _ratings;
std::list<int64_t> _reel_lengths;
std::map<dcp::Marker, dcp::Time> _markers;
std::vector<dcp::Rating> _ratings;
- std::
string _content_version
;
+ std::
vector<std::string> _content_versions
;
bool _has_atmos;
Frame _atmos_length;
dcp::Fraction _atmos_edit_rate;
bool _has_atmos;
Frame _atmos_length;
dcp::Fraction _atmos_edit_rate;
diff --git
a/test/import_dcp_test.cc
b/test/import_dcp_test.cc
index 07116c1e26f0e0f058702a1b1760f527dc2ca740..ad6fc88ca54de8c7fddc14f6c434bff66bd2e6a5 100644
(file)
--- a/
test/import_dcp_test.cc
+++ b/
test/import_dcp_test.cc
@@
-185,7
+185,7
@@
BOOST_AUTO_TEST_CASE (import_dcp_metadata_test)
film2->write_metadata ();
BOOST_CHECK (imported->ratings() == ratings);
film2->write_metadata ();
BOOST_CHECK (imported->ratings() == ratings);
- BOOST_CHECK
_EQUAL (imported->content_version(), "Fred"
);
+ BOOST_CHECK
(imported->content_versions() == cv
);
/* Load that film and check that the metadata has been loaded */
shared_ptr<Film> film3(new Film(boost::filesystem::path("build/test/import_dcp_metadata_test2")));
/* Load that film and check that the metadata has been loaded */
shared_ptr<Film> film3(new Film(boost::filesystem::path("build/test/import_dcp_metadata_test2")));
@@
-195,6
+195,6
@@
BOOST_AUTO_TEST_CASE (import_dcp_metadata_test)
BOOST_REQUIRE (reloaded);
BOOST_CHECK (reloaded->ratings() == ratings);
BOOST_REQUIRE (reloaded);
BOOST_CHECK (reloaded->ratings() == ratings);
- BOOST_CHECK
_EQUAL (reloaded->content_version(), "Fred"
);
+ BOOST_CHECK
(reloaded->content_versions() == cv
);
}
}