From b7cedf45ed8de32fc9384d5bc18dfcdc3376111c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 9 Jan 2014 16:15:01 +0000 Subject: Bump maximum number of frames in memory for high thread counts. Make sure that we push later frames to disk where necessary rather than earlier ones. --- src/lib/writer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 8d9b5855e..21274cb83 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -48,7 +48,7 @@ using std::cout; using boost::shared_ptr; using boost::weak_ptr; -int const Writer::_maximum_frames_in_memory = 8; +int const Writer::_maximum_frames_in_memory = Config::num_local_encoding_threads() + 4; Writer::Writer (shared_ptr f, weak_ptr j) : _film (f) @@ -291,7 +291,8 @@ try Write some FULL frames to disk. */ - /* Find one */ + /* Find one from the back of the queue */ + _queue.sort (); list::reverse_iterator i = _queue.rbegin (); while (i != _queue.rend() && (i->type != QueueItem::FULL || !i->encoded)) { ++i; -- cgit v1.2.3