- QueueItem qi = _queue.back ();
- _queue.pop_back ();
-
- if (qi.type == QueueItem::FULL) {
- lock.unlock ();
- _film->log()->log (String::compose ("Writer full (awaiting %1); pushes %2 to disk", _last_written_frame + 1, qi.frame));
- qi.encoded->write (_film, qi.frame);
- lock.lock ();
- qi.encoded.reset ();
+ /* Find one */
+ list<QueueItem>::reverse_iterator i = _queue.rbegin ();
+ while (i != _queue.rend() && (i->type != QueueItem::FULL || !i->encoded)) {
+ ++i;