X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdecoder.cc;h=7f4973737faff0146f971f91c846cc4c8a5dabef;hb=64dc289b343641fc37db51fcd6b3069078cb5edf;hp=637e0ddb291101af81f28115327f195a3e128116;hpb=89115db77729a2c99f1a09ff6a461720e16f889e;p=dcpomatic.git diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 637e0ddb2..7f4973737 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -23,6 +23,7 @@ #include "film.h" #include "decoder.h" +#include "decoded.h" #include "i18n.h" @@ -34,5 +35,40 @@ using boost::shared_ptr; Decoder::Decoder (shared_ptr f) : _film (f) { - _film_connection = f->Changed.connect (bind (&Decoder::film_changed, this, _1)); + +} + +class DecodedSorter +{ +public: + bool operator() (shared_ptr a, shared_ptr b) + { + return a->dcp_time < b->dcp_time; + } +}; + +shared_ptr +Decoder::peek () +{ + while (_pending.empty() && !pass ()) {} + + if (_pending.empty ()) { + return shared_ptr (); + } + + return _pending.front (); +} + +void +Decoder::consume () +{ + if (!_pending.empty ()) { + _pending.pop_front (); + } +} + +void +Decoder::seek (ContentTime, bool) +{ + _pending.clear (); }