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.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 7102f2aa4..4e136d619 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -27,6 +27,7 @@
#include "i18n.h"
+using std::cout;
using boost::shared_ptr;
/** @param f Film.
@@ -34,6 +35,7 @@ using boost::shared_ptr;
*/
Decoder::Decoder (shared_ptr<const Film> f)
: _film (f)
+ , _done (false)
{
}
@@ -41,9 +43,11 @@ Decoder::Decoder (shared_ptr<const Film> f)
shared_ptr<Decoded>
Decoder::peek ()
{
- while (_pending.empty() && !pass ()) {}
+ while (!_done && _pending.empty ()) {
+ _done = pass ();
+ }
- if (_pending.empty ()) {
+ if (_done) {
return shared_ptr<Decoded> ();
}
@@ -62,4 +66,5 @@ void
Decoder::seek (ContentTime, bool)
{
_pending.clear ();
+ _done = false;
}