summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-10 14:13:56 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-10 14:13:56 +0000
commitb0b5d621c851ea22f5328fcb4d212936d670804f (patch)
treebea6aeed232e6b39eadcb2ba68c315e968783f54 /src/lib
parent70d05207891ab63e1384a77d43df62addc3eb54c (diff)
More windows debug.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/writer.cc43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 558eda97e..cfc19a13d 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -45,6 +45,7 @@ using std::pair;
using std::string;
using std::list;
using std::cout;
+using std::stringstream;
using boost::shared_ptr;
using boost::weak_ptr;
@@ -91,6 +92,17 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
_picture_asset->set_key (_film->key ());
}
+ _picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0);
+
+ _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 ());
+ _sound_asset->set_sampling_rate (_film->audio_frame_rate ());
+
+ if (_film->encrypted ()) {
+ _sound_asset->set_key (_film->key ());
+ }
+
/* 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.
@@ -98,25 +110,32 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
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 ())
+ ec.value ()
+ )
);
}
- _picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0);
-
- _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 ());
- _sound_asset->set_sampling_rate (_film->audio_frame_rate ());
-
- if (_film->encrypted ()) {
- _sound_asset->set_key (_film->key ());
- }
-
_sound_asset_writer = _sound_asset->start_write ();
_thread = new boost::thread (boost::bind (&Writer::thread, this));