summaryrefslogtreecommitdiff
path: root/src/lib/dcp_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-08 20:41:57 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-08 20:41:57 +0000
commite3f2d81e7e7d3b36d47020b5704fcc36d6959952 (patch)
treeb40b74eb97fc6e8a1fd375a96241a987b92241dd /src/lib/dcp_decoder.cc
parent18dbb50a911612e3148ccb1479928fda74b83194 (diff)
Pass DCP subtitles before video so that they are present when the video frame looks for them.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
-rw-r--r--src/lib/dcp_decoder.cc7
1 files changed, 5 insertions, 2 deletions
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<dcp::PictureAsset> 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 ()) {