From 9adf0dc99f0da3d45950a693193b9123d025b668 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Jul 2014 11:27:55 +0100 Subject: [PATCH] Write subtitle intrinsic durations to match the picture in the reel; sort out test fiasco after making libdcp compare DCPs properly again. --- src/lib/transcoder.cc | 3 ++- src/lib/writer.cc | 2 +- test/test.cc | 1 + test/wscript | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index 1012c4544..9d8eebe25 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -62,7 +62,8 @@ Transcoder::go () _encoder->begin (); DCPTime const frame = DCPTime::from_frames (1, _film->video_frame_rate ()); - for (DCPTime t; t < _film->length(); t += frame) { + DCPTime const length = _film->length (); + for (DCPTime t; t < length; t += frame) { list > v = _player->get_video (t, true); for (list >::const_iterator i = v.begin(); i != v.end(); ++i) { _encoder->enqueue (*i); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index c34a6a66d..c594a6446 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -466,7 +466,7 @@ Writer::finish () new dcp::ReelSubtitleAsset ( _subtitle_content, dcp::Fraction (_film->video_frame_rate(), 1), - _subtitle_content->latest_subtitle_out().to_seconds() * _film->video_frame_rate(), + _picture_mxf->intrinsic_duration (), 0 ) )); diff --git a/test/test.cc b/test/test.cc index 4466b74cb..cbf4b5d4d 100644 --- a/test/test.cc +++ b/test/test.cc @@ -162,6 +162,7 @@ check_dcp (boost::filesystem::path ref, boost::filesystem::path check) options.max_audio_sample_error = 255; options.cpl_annotation_texts_can_differ = true; options.mxf_names_can_differ = true; + options.reel_hashes_can_differ = true; BOOST_CHECK (ref_dcp.equals (check_dcp, options, boost::bind (note, _1, _2))); } diff --git a/test/wscript b/test/wscript index 3345d9eb8..493836a7a 100644 --- a/test/wscript +++ b/test/wscript @@ -37,6 +37,7 @@ def build(bld): film_metadata_test.cc frame_rate_test.cc image_test.cc + import_dcp_test.cc isdcf_name_test.cc job_test.cc make_black_test.cc -- 2.30.2