Rename Subtitle -> Text
[dcpomatic.git] / src / lib / decoder.cc
index fef5e2a99f9c64271f95986490ab9f68ab333185..e7e6b8620e9332e0dc51f79f8c5d4e743f884758 100644 (file)
 #include "decoder.h"
 #include "video_decoder.h"
 #include "audio_decoder.h"
-#include "subtitle_decoder.h"
+#include "text_decoder.h"
 #include <boost/optional.hpp>
 #include <iostream>
 
 using std::cout;
 using boost::optional;
 
+/** @return Earliest time of content that the next pass() will emit */
 ContentTime
 Decoder::position () const
 {
        optional<ContentTime> pos;
 
-       if (video && (!pos || video->position() < *pos)) {
+       if (video && !video->ignore() && (!pos || video->position() < *pos)) {
                pos = video->position();
        }
 
-       if (audio && (!pos || audio->position() < *pos)) {
+       if (audio && !audio->ignore() && (!pos || audio->position() < *pos)) {
                pos = audio->position();
        }
 
-       if (subtitle && (!pos || subtitle->position() < *pos)) {
+       if (subtitle && !subtitle->ignore() && (!pos || subtitle->position() < *pos)) {
                pos = subtitle->position();
        }
 
@@ -51,7 +52,13 @@ Decoder::position () const
 void
 Decoder::seek (ContentTime, bool)
 {
+       if (video) {
+               video->seek ();
+       }
        if (audio) {
                audio->seek ();
        }
+       if (subtitle) {
+               subtitle->seek ();
+       }
 }