Don't bother decoding video frames when we're seeking around trying to find subtitles.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 20a9f32fee031ddd99fc03f19ab1d5182614e6f7..93a122590749b848d3eea519177c5f8bd61ce56a 100644 (file)
@@ -17,9 +17,9 @@
 
 */
 
-#include <dcp/subtitle_content.h>
 #include "dcp_subtitle_decoder.h"
 #include "dcp_subtitle_content.h"
+#include <dcp/interop_subtitle_content.h>
 
 using std::list;
 using std::cout;
@@ -28,8 +28,8 @@ using boost::shared_ptr;
 DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
        : SubtitleDecoder (content)
 {
-       dcp::SubtitleContent c (content->path (0), false);
-       _subtitles = c.subtitles ();
+       shared_ptr<dcp::SubtitleContent> c (load (content->path (0)));
+       _subtitles = c->subtitles ();
        _next = _subtitles.begin ();
 }
 
@@ -46,7 +46,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
 }
 
 bool
-DCPSubtitleDecoder::pass ()
+DCPSubtitleDecoder::pass (PassReason)
 {
        if (_next == _subtitles.end ()) {
                return true;
@@ -61,7 +61,13 @@ DCPSubtitleDecoder::pass ()
 }
 
 list<ContentTimePeriod>
-DCPSubtitleDecoder::subtitles_during (ContentTimePeriod p, bool starting) const
+DCPSubtitleDecoder::image_subtitles_during (ContentTimePeriod, bool) const
+{
+       return list<ContentTimePeriod> ();
+}
+       
+list<ContentTimePeriod>
+DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const
 {
        /* XXX: inefficient */