- dcp.write_xml (_film->interop () ? dcp::INTEROP : dcp::SMPTE, meta, signer, Config::instance()->dcp_metadata_filename_format());
+ cpl->set_main_sound_configuration (msc.to_string());
+ cpl->set_main_sound_sample_rate (film()->audio_frame_rate());
+ cpl->set_main_picture_stored_area (film()->frame_size());
+
+ auto active_area = film()->active_area();
+ if (active_area.width > 0 && active_area.height > 0) {
+ /* It's not allowed to have a zero active area width or height */
+ cpl->set_main_picture_active_area (active_area);
+ }
+
+ auto sl = film()->subtitle_languages().second;
+ if (!sl.empty()) {
+ cpl->set_additional_subtitle_languages(sl);
+ }
+
+ auto signer = Config::instance()->signer_chain();
+ /* We did check earlier, but check again here to be on the safe side */
+ string reason;
+ if (!signer->valid (&reason)) {
+ throw InvalidSignerError (reason);
+ }
+
+ dcp.write_xml (
+ issuer,
+ creator,
+ dcp::LocalTime().as_string(),
+ film()->dcp_name(),
+ signer,
+ Config::instance()->dcp_metadata_filename_format()
+ );