* @brief Parent class for decoders of content.
*/
-#include "film.h"
#include "decoder.h"
#include "decoded.h"
using std::cout;
using boost::shared_ptr;
-/** @param f Film.
- * @param o Decode options.
+/** @param o Decode options.
*/
-Decoder::Decoder (shared_ptr<const Film> f)
- : _film (f)
- , _done (false)
+Decoder::Decoder ()
+ : _done (false)
{
}
+struct DecodedSorter
+{
+ bool operator() (shared_ptr<Decoded> a, shared_ptr<Decoded> b)
+ {
+ return a->dcp_time < b->dcp_time;
+ }
+};
+
shared_ptr<Decoded>
Decoder::peek ()
{
_done = pass ();
}
- if (_done) {
+ if (_done && _pending.empty ()) {
return shared_ptr<Decoded> ();
}
+ _pending.sort (DecodedSorter ());
return _pending.front ();
}