summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_content.cc11
-rw-r--r--src/lib/dcp_content.h2
-rw-r--r--src/lib/dcp_examiner.cc5
-rw-r--r--src/lib/dcp_examiner.h7
4 files changed, 17 insertions, 8 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 29974a785..642659170 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -134,10 +134,10 @@ DCPContent::DCPContent (boost::filesystem::path p)
, _reference_video (false)
, _reference_audio (false)
, _three_d (false)
+ , _directory(p)
{
LOG_GENERAL ("Creating DCP content from %1", p.string());
- set_paths(read_directory(p));
set_default_colour_conversion ();
}
@@ -232,13 +232,14 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
ContentChangeSignaller cc_kdm (this, DCPContentProperty::NEEDS_KDM);
ContentChangeSignaller cc_name (this, DCPContentProperty::NAME);
+ auto examiner = make_shared<DCPExaminer>(shared_from_this(), film ? film->tolerant() : true, _directory ? read_directory(*_directory) : paths());
+ set_paths(examiner->paths());
+
if (job) {
job->set_progress_unknown ();
}
Content::examine (film, job);
- auto examiner = make_shared<DCPExaminer>(shared_from_this(), film ? film->tolerant() : true);
-
if (examiner->has_video()) {
{
boost::mutex::scoped_lock lm (_mutex);
@@ -559,7 +560,7 @@ DCPContent::reels (shared_ptr<const Film> film) const
if (reel_lengths.empty()) {
/* Old metadata with no reel lengths; get them here instead */
try {
- scoped_ptr<DCPExaminer> examiner (new DCPExaminer(shared_from_this(), film->tolerant()));
+ scoped_ptr<DCPExaminer> examiner(new DCPExaminer(shared_from_this(), film->tolerant(), paths()));
reel_lengths = examiner->reel_lengths ();
} catch (...) {
/* Could not examine the DCP; guess reels */
@@ -864,7 +865,7 @@ DCPContent::check_font_ids()
return;
}
- DCPExaminer examiner(shared_from_this(), true);
+ DCPExaminer examiner(shared_from_this(), true, paths());
add_fonts_from_examiner(text.front(), examiner.fonts());
}
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h
index eb62ac354..a760fcd65 100644
--- a/src/lib/dcp_content.h
+++ b/src/lib/dcp_content.h
@@ -223,6 +223,8 @@ private:
std::map<dcp::Marker, dcpomatic::ContentTime> _markers;
std::vector<dcp::Rating> _ratings;
std::vector<std::string> _content_versions;
+
+ boost::optional<boost::filesystem::path> _directory;
};
diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc
index 9c4f899c6..b9ff3a238 100644
--- a/src/lib/dcp_examiner.cc
+++ b/src/lib/dcp_examiner.cc
@@ -61,11 +61,12 @@ using std::vector;
using boost::optional;
-DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
+DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant, vector<boost::filesystem::path> const& paths)
+ : _paths(paths)
{
shared_ptr<dcp::CPL> selected_cpl;
- auto cpls = dcp::find_and_resolve_cpls (content->directories(), tolerant);
+ auto cpls = dcp::find_and_resolve_cpls(dcp::DCP::directories_from_files(_paths), tolerant);
if (content->cpl ()) {
/* Use the CPL that was specified, or that the content was using before */
diff --git a/src/lib/dcp_examiner.h b/src/lib/dcp_examiner.h
index b51e7ae7a..f111a5205 100644
--- a/src/lib/dcp_examiner.h
+++ b/src/lib/dcp_examiner.h
@@ -38,7 +38,7 @@ class DCPContent;
class DCPExaminer : public VideoExaminer, public AudioExaminer
{
public:
- DCPExaminer(std::shared_ptr<const DCPContent>, bool tolerant);
+ DCPExaminer(std::shared_ptr<const DCPContent>, bool tolerant, std::vector<boost::filesystem::path> const& files);
bool has_video () const override {
return _has_video;
@@ -174,6 +174,10 @@ public:
return _fonts;
}
+ std::vector<boost::filesystem::path> paths() const {
+ return _paths;
+ }
+
private:
boost::optional<double> _video_frame_rate;
boost::optional<dcp::Size> _video_size;
@@ -207,4 +211,5 @@ private:
Frame _atmos_length = 0;
dcp::Fraction _atmos_edit_rate;
std::vector<std::vector<std::shared_ptr<dcpomatic::Font>>> _fonts;
+ std::vector<boost::filesystem::path> _paths;
};