DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content, shared_ptr<Log> log)
{
- subtitle.reset (new SubtitleDecoder (this, content->subtitle, log));
-
shared_ptr<dcp::SubtitleAsset> 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
-DCPSubtitleDecoder::seek (ContentTime time, bool)
+DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
{
+ Decoder::seek (time, accurate);
+
_next = _subtitles.begin ();
list<dcp::SubtitleString>::const_iterator i = _subtitles.begin ();
while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().as_seconds()) < time) {