summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-09 21:05:22 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-09 21:05:22 +0000
commit94f3283614dcd153eddf5a5593115ca782138733 (patch)
treec922f388e5f14e492e4dc11708eaba77cc899570 /src/lib
parentf89b75d3b0cd0b30decedbcfd27ff38b81c679a3 (diff)
Delete existing audio MXFs before creating new ones, as apparently Windows needs this in some circumstances.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/writer.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index c5cc8c617..320528682 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -94,8 +94,15 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
_picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0);
/* Write the sound asset into the film directory so that we leave the creation
- of the DCP directory until the last minute.
+ 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 (_film->file (_film->audio_mxf_filename ()), ec);
+ if (ec) {
+ _film->log()->log (String::compose ("Could not remove existing audio MXF file (%1)", ec.value ()));
+ }
+
_sound_asset.reset (new libdcp::SoundAsset (_film->directory (), _film->audio_mxf_filename ()));
_sound_asset->set_edit_rate (_film->video_frame_rate ());
_sound_asset->set_channels (_film->audio_channels ());
@@ -106,9 +113,6 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
}
_sound_asset_writer = _sound_asset->start_write ();
-#ifdef DCPOMATIC_WINDOWS
- _film->log()->log (String::compose ("DEBUG: %1", GetLastError ()));
-#endif
_thread = new boost::thread (boost::bind (&Writer::thread, this));