Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / decoder.cc
index fef5e2a99f9c64271f95986490ab9f68ab333185..0d4f4babfa9db0831650529ae4ead927260dc7f3 100644 (file)
 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();
        }
 
@@ -54,4 +55,7 @@ Decoder::seek (ContentTime, bool)
        if (audio) {
                audio->seek ();
        }
+       if (subtitle) {
+               subtitle->seek ();
+       }
 }