From f1bfe8575b3e2d2e90e2e623e60082bc1938ba64 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 30 Oct 2015 15:53:27 +0000 Subject: Disallow referencing of things which are not present in DCPs. --- src/lib/dcp_content.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') 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& why_not) const bool DCPContent::can_reference_audio (list& why_not) const { + DCPDecoder decoder (shared_from_this(), false); + BOOST_FOREACH (shared_ptr 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 (_("There is other audio content overlapping this DCP; remove it."), why_not); } bool DCPContent::can_reference_subtitle (list& why_not) const { + DCPDecoder decoder (shared_from_this(), false); + BOOST_FOREACH (shared_ptr 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 (_("There is other subtitle content overlapping this DCP; remove it."), why_not); } -- cgit v1.2.3