Add some tests; fix failure to make DCP when there is a bit of audio right at the...
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 9db3254019675061cc0f8095abb9f89604b111f1..04b264192cd9d43c184449820b9c16213118ed28 100644 (file)
@@ -38,8 +38,10 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> con
 }
 
 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) {
@@ -47,11 +49,11 @@ DCPSubtitleDecoder::seek (ContentTime time, bool)
        }
 }
 
-void
+bool
 DCPSubtitleDecoder::pass ()
 {
        if (_next == _subtitles.end ()) {
-               return;
+               return true;
        }
 
        /* Gather all subtitles with the same time period that are next
@@ -70,7 +72,7 @@ DCPSubtitleDecoder::pass ()
        }
 
        subtitle->emit_text (p, s);
-       subtitle->set_position (p.from);
+       return false;
 }
 
 ContentTimePeriod