From de2af791bdfdcd653752cba970e59efc7bf810c7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 21 Nov 2016 16:57:15 +0000 Subject: Basic grunt-work, untested and unfinished, but it compiles. --- src/lib/decoder.cc | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src/lib/decoder.cc') 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 + Copyright (C) 2012-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -19,19 +19,26 @@ */ #include "decoder.h" -#include "decoder_part.h" -#include +#include "video_decoder.h" +#include "audio_decoder.h" +#include "subtitle_decoder.h" -using std::cout; -using boost::optional; - -void -Decoder::maybe_seek (optional 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; } -- cgit v1.2.3