#include "film.h"
#include "decoder.h"
+#include "decoded.h"
#include "i18n.h"
Decoder::Decoder (shared_ptr<const Film> f)
: _film (f)
{
- _film_connection = f->Changed.connect (bind (&Decoder::film_changed, this, _1));
+
+}
+
+class DecodedSorter
+{
+public:
+ bool operator() (shared_ptr<Decoded> a, shared_ptr<Decoded> b)
+ {
+ return a->dcp_time < b->dcp_time;
+ }
+};
+
+shared_ptr<Decoded>
+Decoder::peek ()
+{
+ while (_pending.empty() && !pass ()) {}
+
+ if (_pending.empty ()) {
+ return shared_ptr<Decoded> ();
+ }
+
+ return _pending.front ();
+}
+
+void
+Decoder::consume ()
+{
+ if (!_pending.empty ()) {
+ _pending.pop_front ();
+ }
+}
+
+void
+Decoder::seek (ContentTime, bool)
+{
+ _pending.clear ();
}