- /* Write the sound asset into the film directory so that we leave the creation
- of the DCP directory until the last minute. Some versions of windows inexplicably
- don't like overwriting existing files here, so try to remove it using boost.
- */
- boost::system::error_code ec;
- boost::filesystem::remove_all (_film->file (_film->audio_mxf_filename ()), ec);
- if (ec) {
-
- stringstream s;
- boost::filesystem::path p = _film->file (_film->audio_mxf_filename ());
- s << p << "\n"
- << "exists=" << boost::filesystem::exists (p) << "\n"
- << "file_size=" << boost::filesystem::file_size (p) << "\n"
- << "hard_link_count=" << boost::filesystem::hard_link_count (p) << "\n"
- << "is_directory=" << boost::filesystem::is_directory (p) << "\n"
- << "is_empty=" << boost::filesystem::is_empty (p) << "\n"
- << "is_other=" << boost::filesystem::is_other (p) << "\n"
- << "is_regular_file=" << boost::filesystem::is_regular_file (p) << "\n"
- << "last_write_time=" << boost::filesystem::last_write_time (p) << "\n"
- << "type=" << boost::filesystem::status (p).type () << "\n"
- << "permissions=" << boost::filesystem::status (p).permissions () << "\n";
-
- _film->log()->log (s.str ());
-
- _film->log()->log (
- String::compose (
- "Could not remove existing audio MXF file %1 (%2)",
- _film->file (_film->audio_mxf_filename ()),
- ec.value ()
- )
- );
+ /* Write the sound MXF into the film directory so that we leave the creation
+ of the DCP directory until the last minute.
+ */
+ _sound_mxf_writer = _sound_mxf->start_write (_film->directory() / _film->audio_mxf_filename(), _film->interop() ? dcp::INTEROP : dcp::SMPTE);