#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();
}
void
Decoder::seek (ContentTime, bool)
{
+ if (video) {
+ video->seek ();
+ }
if (audio) {
audio->seek ();
}
+ if (subtitle) {
+ subtitle->seek ();
+ }
}