summaryrefslogtreecommitdiff
path: root/src/lib/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/decoder.cc')
-rw-r--r--src/lib/decoder.cc31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 114e2ebb4..785fb96f0 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -19,19 +19,26 @@
*/
#include "decoder.h"
-#include "decoder_part.h"
-#include <iostream>
+#include "video_decoder.h"
+#include "audio_decoder.h"
+#include "subtitle_decoder.h"
-using std::cout;
-using boost::optional;
-
-void
-Decoder::maybe_seek (optional<ContentTime> position, ContentTime time, bool accurate)
+ContentTime
+Decoder::position () const
{
- if (position && (time >= position.get() && time < (position.get() + ContentTime::from_seconds(1)))) {
- /* No need to seek: caller should just pass() */
- return;
+ ContentTime pos;
+
+ if (video && video->position()) {
+ pos = min (pos, video->position().get());
+ }
+
+ if (audio && audio->position()) {
+ pos = min (pos, audio->position().get());
+ }
+
+ if (subtitle && subtitle->position()) {
+ pos = min (pos, subtitle->position().get());
}
- seek (time, accurate);
+ return pos;
}