- /* Put 1 frame of black at the start so when we seek to 0 we don't see anything */
- DCPTime position = DCPTime::from_frames(1, _film->video_frame_rate());
- shared_ptr<DCPContent> first;
-
- BOOST_FOREACH (SPLEntry i, spl.playlist) {
- shared_ptr<DCPContent> dcp;
- try {
- dcp.reset (new DCPContent (_film, i.directory));
- } catch (boost::filesystem::filesystem_error& e) {
- error_dialog (this, _("Could not load DCP"), std_to_wx (e.what()));
- return;
- }
-
- if (!first) {
- first = dcp;
- }
-
- _film->examine_and_add_content (dcp, true);
- bool const ok = progress (_("Loading DCP"));
- if (!ok || !report_errors_from_last_job()) {
- return;
- }
-
- dcp->set_position (position + i.black_before);
- position += dcp->length_after_trim() + i.black_before;
-
- /* This DCP has been examined and loaded */
-
- if (dcp->needs_kdm()) {
- optional<dcp::EncryptedKDM> kdm;
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- kdm = get_kdm_from_url (dcp);
-#endif
- if (!kdm) {
- get_kdm_from_directory (dcp);
- }
-
- if (kdm) {
- dcp->add_kdm (*kdm);
- dcp->examine (shared_ptr<Job>());
- }
- }