Listen for server replies on different ports on main and batch, and get servers to...
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 04b264192cd9d43c184449820b9c16213118ed28..965f9db61dc20d9719b16a2a0a2d8ecdc027fa0d 100644 (file)
@@ -30,11 +30,15 @@ using boost::bind;
 
 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