More player debugging for butler video-full states.
[dcpomatic.git] / src / lib / dcp_subtitle_decoder.cc
index 46256e93ef43f6d57607693f723658414b0d414e..6c95b8b1fa4aadcc99396e51d3e09102d7739104 100644 (file)
@@ -29,7 +29,8 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::bind;
 
-DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content, shared_ptr<Log> log)
+DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<const DCPSubtitleContent> content)
+       : Decoder (film)
 {
        shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
        _subtitles = c->subtitles ();
@@ -39,7 +40,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> con
        if (_next != _subtitles.end()) {
                first = content_time_period(*_next).from;
        }
-       subtitle.reset (new SubtitleDecoder (this, content->subtitle, log, first));
+       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), first)));
 }
 
 void
@@ -63,8 +64,8 @@ DCPSubtitleDecoder::pass ()
 
        /* Gather all subtitles with the same time period that are next
           on the list.  We must emit all subtitles for the same time
-          period with the same text_subtitle() call otherwise the
-          SubtitleDecoder will assume there is nothing else at the
+          period with the same plain_text() call otherwise the
+          TextDecoder will assume there is nothing else at the
           time of emit the first.
        */
 
@@ -81,7 +82,7 @@ DCPSubtitleDecoder::pass ()
                /* XXX: image subtitles */
        }
 
-       subtitle->emit_text (p, s);
+       only_text()->emit_plain (p, s);
        return false;
 }