- DCPDecoder decoder (shared_from_this(), film()->log());
- 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."));
+ shared_ptr<DCPDecoder> decoder;
+ try {
+ decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
+ } catch (dcp::DCPReadError) {
+ /* We couldn't read the DCP, so it's probably missing */
+ return false;
+ } catch (dcp::KDMDecryptionError) {
+ /* We have an incorrect KDM */
+ return false;
+ }
+
+ BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {
+ if (type == CAPTION_OPEN && !i->main_subtitle()) {
+ /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
+ why_not = _("it does not have subtitles in all its reels.");