summaryrefslogtreecommitdiff
path: root/src/lib/dcp_decoder.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_decoder.cc
parent3855bfd7991b1d7411934fc564dd5714eca6bc1b (diff)
Remove DCP class and replace its functionality with a plain method in libdcp.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
-rw-r--r--src/lib/dcp_decoder.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index 85c5d3297..542a8ff7c 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -44,6 +44,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_reader.h>
#include <dcp/sound_frame.h>
#include <dcp/stereo_picture_asset.h>
@@ -68,8 +69,8 @@ using namespace dcpomatic;
DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent> content, bool fast, bool tolerant, shared_ptr<DCPDecoder> old)
- : DCP (content, tolerant)
- , Decoder (film)
+ : Decoder (film)
+ , _dcp_content (content)
{
if (content->can_be_played()) {
if (content->video) {
@@ -101,7 +102,7 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
_reels = old->_reels;
} else {
- auto cpl_list = cpls ();
+ auto cpl_list = dcp::find_and_resolve_cpls(content->directories(), tolerant);
if (cpl_list.empty()) {
throw DCPError (_("No CPLs found in DCP."));
@@ -118,7 +119,11 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
/* No CPL found; probably an old file that doesn't specify it;
just use the first one.
*/
- cpl = cpls().front ();
+ cpl = cpl_list.front();
+ }
+
+ if (content->kdm()) {
+ cpl->add (decrypt_kdm_with_helpful_error(content->kdm().get()));
}
_reels = cpl->reels ();