From 063342ee490e86c1cd0b83b2dca36e943caf1ff0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Apr 2015 11:39:55 +0100 Subject: [PATCH] Hand-apply dbaf6da70557cc94550e95130cb697ce6a100586 from master; use the picture MXF's filename decided at the start of the encode the whole way through the encode. --- src/lib/writer.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/lib/writer.cc b/src/lib/writer.cc index e8a4ac10b..4270a42a7 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -92,9 +92,6 @@ Writer::Writer (shared_ptr f, weak_ptr j) shared_ptr job = _job.lock (); DCPOMATIC_ASSERT (job); - job->sub (_("Checking existing image data")); - check_existing_picture_mxf (); - /* Create our picture asset in a subdirectory, named according to those film's parameters which affect the video output. We will hard-link it into the DCP later. @@ -106,6 +103,9 @@ Writer::Writer (shared_ptr f, weak_ptr j) _picture_mxf.reset (new dcp::MonoPictureMXF (dcp::Fraction (_film->video_frame_rate (), 1))); } + job->sub (_("Checking existing image data")); + check_existing_picture_mxf (); + _picture_mxf->set_size (_film->frame_size ()); if (_film->encrypted ()) { @@ -438,9 +438,7 @@ Writer::finish () } /* 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_from = _picture_mxf->file (); boost::filesystem::path video_to; video_to /= _film->dir (_film->dcp_name()); @@ -594,12 +592,9 @@ void Writer::check_existing_picture_mxf () { /* Try to open the existing MXF */ - boost::filesystem::path p; - p /= _film->internal_video_mxf_dir (); - p /= _film->internal_video_mxf_filename (); - FILE* mxf = fopen_boost (p, "rb"); + FILE* mxf = fopen_boost (_picture_mxf->file(), "rb"); if (!mxf) { - LOG_GENERAL ("Could not open existing MXF at %1 (errno=%2)", p.string(), errno); + LOG_GENERAL ("Could not open existing MXF at %1 (errno=%2)", _picture_mxf->file().string(), errno); return; } -- 2.30.2