From 6a68937320fa76ce213c648845abc73983fc1849 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 13 Dec 2017 22:04:49 +0000 Subject: Setup SubtitleDecoder::_position correctly (in some cases). --- src/lib/dcp_subtitle_decoder.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/dcp_subtitle_decoder.cc') diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 04b264192..965f9db61 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -30,11 +30,15 @@ using boost::bind; DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr content, shared_ptr log) { - subtitle.reset (new SubtitleDecoder (this, content->subtitle, log)); - shared_ptr c (load (content->path (0))); _subtitles = c->subtitles (); _next = _subtitles.begin (); + + ContentTime first; + if (_next != _subtitles.end()) { + first = content_time_period(*_next).from; + } + subtitle.reset (new SubtitleDecoder (this, content->subtitle, log, first)); } void -- cgit v1.2.3