, _queued_full_in_memory (0)
, _last_written_frame (-1)
, _last_written_eyes (EYES_RIGHT)
+ , _maximum_frames_in_memory (0)
, _full_written (0)
, _fake_written (0)
, _pushed_to_disk (0)
{
boost::mutex::scoped_lock lock (_mutex);
- while (_queued_full_in_memory > maximum_frames_in_memory ()) {
+ while (_queued_full_in_memory > _maximum_frames_in_memory) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
{
boost::mutex::scoped_lock lock (_mutex);
- while (_queued_full_in_memory > maximum_frames_in_memory ()) {
+ while (_queued_full_in_memory > _maximum_frames_in_memory) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
while (true) {
- if (_finish || _queued_full_in_memory > maximum_frames_in_memory () || have_sequenced_image_at_queue_head ()) {
+ if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) {
/* We've got something to do: go and do it */
break;
}
}
}
- while (_queued_full_in_memory > maximum_frames_in_memory ()) {
+ while (_queued_full_in_memory > _maximum_frames_in_memory) {
done_something = true;
/* Too many frames in memory which can't yet be written to the stream.
Write some FULL frames to disk.
return a.frame == b.frame && a.eyes == b.eyes;
}
-int
-Writer::maximum_frames_in_memory () const
+void
+Writer::set_encoder_threads (int threads)
{
- return Config::instance()->num_local_encoding_threads() + 4;
+ _maximum_frames_in_memory = rint (threads * 1.1);
}