-/** @param f Film.
- * @param o Options.
- * @param j Job that we are running within, or 0
- */
-Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j)
- : _film (f)
- , _opt (o)
- , _job (j)
+/** @return Earliest time of content that the next pass() will emit */
+ContentTime
+Decoder::position () const
+{
+ optional<ContentTime> pos;
+
+ if (video && !video->ignore() && (!pos || video->position() < *pos)) {
+ pos = video->position();
+ }
+
+ if (audio && !audio->ignore() && (!pos || audio->position() < *pos)) {
+ pos = audio->position();
+ }
+
+ if (subtitle && !subtitle->ignore() && (!pos || subtitle->position() < *pos)) {
+ pos = subtitle->position();
+ }
+
+ return pos.get_value_or(ContentTime());
+}
+
+void
+Decoder::seek (ContentTime, bool)