diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-28 00:12:32 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-28 00:12:32 +0000 |
| commit | 0987c41ac468fd93bbb444093e66d5d6753cb927 (patch) | |
| tree | 15bffbeac0e71cb876cd7d0395421463cbaff1b9 /src/lib/decoder.cc | |
| parent | ec95ff05f66e9b4cf3bcdbefa0c75ca8f99dc279 (diff) | |
Fix termination of decodes.
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 9 |
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; } |
