X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Freel_writer.cc;h=e008bf6311ae5acbcbcfa8a1b1d41bbfb75aa225;hb=d2c4aba65a9eb2ee75961cdc860d2f3aa0b1a548;hp=d742818ae08849bfe81e191c3f922deb01a3b6c0;hpb=4a5fcd19ca16447ba8b204986a378072a9c730b2;p=dcpomatic.git diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index d742818ae..e008bf631 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -88,6 +88,7 @@ ReelWriter::ReelWriter ( if (_film->encrypted ()) { _picture_asset->set_key (_film->key ()); + _picture_asset->set_context_id (_film->context_id ()); } _picture_asset->set_file ( @@ -130,7 +131,20 @@ ReelWriter::write_frame_info (Frame frame, Eyes eyes, dcp::FrameInfo info) const { FILE* file = 0; boost::filesystem::path info_file = _film->info_file (_period); + bool const read = boost::filesystem::exists (info_file); + +#ifdef DCPOMATIC_WINDOWS + if (read) { + LOG_GENERAL ( + "Checked %1 (which exists) length is %2 perms are %3", + info_file, boost::filesystem::file_size (info_file), int(boost::filesystem::status(info_file).permissions()) + ); + } else { + LOG_GENERAL ("Checked %1 (which does not exist)", info_file); + } +#endif + if (read) { file = fopen_boost (info_file, "r+b"); } else { @@ -262,6 +276,7 @@ ReelWriter::finish () { if (!_picture_asset_writer->finalize ()) { /* Nothing was written to the picture asset */ + LOG_GENERAL ("Nothing was written to reel %1 of %2", _reel_index, _reel_count); _picture_asset.reset (); } @@ -330,15 +345,21 @@ ReelWriter::create_reel (list const & refs, list k = dynamic_pointer_cast (j.asset); + if (k) { + LOG_GENERAL ("candidate picture asset period is %1-%2", j.period.from.get(), j.period.to.get()); + } if (k && j.period == _period) { reel_picture_asset = k; } } } + LOG_GENERAL ("create_reel for %1-%2; %3 of %4", _period.from.get(), _period.to.get(), _reel_index, _reel_count); + DCPOMATIC_ASSERT (reel_picture_asset); reel->add (reel_picture_asset); @@ -459,7 +480,7 @@ ReelWriter::write (shared_ptr audio) _sound_asset_writer->write (audio->data(), audio->frames()); } - ++_total_written_audio_frames; + _total_written_audio_frames += audio->frames (); } void