summaryrefslogtreecommitdiff
path: root/src/lib/dcp_examiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-20 21:17:54 +0200
committerCarl Hetherington <cth@carlh.net>2022-04-20 21:17:54 +0200
commit86eb90b563efb7ef093d5b17a5d6db0fc330e301 (patch)
tree61d19ca8d8222b8191bd12e650bf4f831b42c180 /src/lib/dcp_examiner.cc
parent3855bfd7991b1d7411934fc564dd5714eca6bc1b (diff)
Remove DCP class and replace its functionality with a plain method in libdcp.
Diffstat (limited to 'src/lib/dcp_examiner.cc')
-rw-r--r--src/lib/dcp_examiner.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc
index cf4835c06..f2ec68bdd 100644
--- a/src/lib/dcp_examiner.cc
+++ b/src/lib/dcp_examiner.cc
@@ -39,6 +39,7 @@
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_subtitle_asset.h>
+#include <dcp/search.h>
#include <dcp/sound_asset.h>
#include <dcp/sound_asset.h>
#include <dcp/sound_asset_reader.h>
@@ -59,7 +60,6 @@ using boost::optional;
DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
- : DCP (content, tolerant)
{
shared_ptr<dcp::CPL> cpl;
@@ -67,9 +67,11 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
_text_count[i] = 0;
}
+ auto cpls = dcp::find_and_resolve_cpls (content->directories(), tolerant);
+
if (content->cpl ()) {
/* Use the CPL that the content was using before */
- for (auto i: cpls()) {
+ for (auto i: cpls) {
if (i->id() == content->cpl().get()) {
cpl = i;
}
@@ -79,7 +81,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
int least_unsatisfied = INT_MAX;
- for (auto i: cpls()) {
+ for (auto i: cpls) {
int unsatisfied = 0;
for (auto j: i->reels()) {
if (j->main_picture() && !j->main_picture()->asset_ref().resolved()) {
@@ -107,6 +109,10 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
throw DCPError ("No CPLs found in DCP");
}
+ if (content->kdm()) {
+ cpl->add (decrypt_kdm_with_helpful_error(content->kdm().get()));
+ }
+
_cpl = cpl->id ();
_name = cpl->content_title_text ();
_content_kind = cpl->content_kind ();