- _picture_mxf_writer->finalize ();
- if (_sound_mxf_writer) {
- _sound_mxf_writer->finalize ();
- }
-
- /* Hard-link the video MXF into the DCP */
- boost::filesystem::path video_from;
- video_from /= _film->internal_video_mxf_dir();
- video_from /= _film->internal_video_mxf_filename();
-
- boost::filesystem::path video_to;
- video_to /= _film->dir (_film->dcp_name());
- video_to /= _film->video_mxf_filename ();
-
- boost::system::error_code ec;
- boost::filesystem::create_hard_link (video_from, video_to, ec);
- if (ec) {
- LOG_WARNING_NC ("Hard-link failed; copying instead");
- boost::filesystem::copy_file (video_from, video_to, ec);
- if (ec) {
- LOG_ERROR ("Failed to copy video file from %1 to %2 (%3)", video_from.string(), video_to.string(), ec.message ());
- throw FileError (ec.message(), video_from);
- }
- }
-
- _picture_mxf->set_file (video_to);