From e3f2d81e7e7d3b36d47020b5704fcc36d6959952 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 8 Feb 2018 20:41:57 +0000 Subject: Pass DCP subtitles before video so that they are present when the video frame looks for them. --- src/lib/dcp_decoder.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/dcp_decoder.cc') diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 14b791aa2..c1c7780bb 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -99,6 +99,11 @@ DCPDecoder::pass () /* Frame within the (played part of the) reel that is coming up next */ int64_t const frame = _next.frames_round (vfr); + /* We must emit subtitles first as when we emit the video for this frame + it will expect already to have the subs. + */ + pass_subtitles (_next); + if ((_mono_reader || _stereo_reader) && (_decode_referenced || !_dcp_content->reference_video())) { shared_ptr asset = (*_reel)->main_picture()->asset (); int64_t const entry_point = (*_reel)->main_picture()->entry_point (); @@ -162,8 +167,6 @@ DCPDecoder::pass () audio->emit (_dcp_content->audio->stream(), data, ContentTime::from_frames (_offset, vfr) + _next); } - pass_subtitles (_next); - _next += ContentTime::from_frames (1, vfr); if ((*_reel)->main_picture ()) { -- cgit v1.2.3