diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-30 15:53:27 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-30 15:53:27 +0000 |
| commit | f1bfe8575b3e2d2e90e2e623e60082bc1938ba64 (patch) | |
| tree | 5f91b3aae715962ce475062b40c9bf15604d57d8 /src/lib | |
| parent | f5f1e2fa18238e4f285b29d755c7de0c19a6d7ee (diff) | |
Disallow referencing of things which are not present in DCPs.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_content.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index c072dfa3d..85fbee012 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -324,11 +324,27 @@ DCPContent::can_reference_video (list<string>& why_not) const bool DCPContent::can_reference_audio (list<string>& why_not) const { + DCPDecoder decoder (shared_from_this(), false); + BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder.reels()) { + if (!i->main_sound()) { + why_not.push_back (_("The DCP does not have sound in all reels.")); + return false; + } + } + return can_reference<AudioContent> (_("There is other audio content overlapping this DCP; remove it."), why_not); } bool DCPContent::can_reference_subtitle (list<string>& why_not) const { + DCPDecoder decoder (shared_from_this(), false); + BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder.reels()) { + if (!i->main_subtitle()) { + why_not.push_back (_("The DCP does not have subtitles in all reels.")); + return false; + } + } + return can_reference<SubtitleContent> (_("There is other subtitle content overlapping this DCP; remove it."), why_not); } |
