, _finish (false)
, _queued_full_in_memory (0)
, _maximum_frames_in_memory (0)
+ , _maximum_queue_size (0)
, _full_written (0)
, _fake_written (0)
, _repeat_written (0)
boost::mutex::scoped_lock lock (_state_mutex);
while (_queued_full_in_memory > _maximum_frames_in_memory) {
- /* The queue is too big; wait until that is sorted out */
+ /* There are too many full frames in memory; wait until that is sorted out */
_full_condition.wait (lock);
}
{
boost::mutex::scoped_lock lock (_state_mutex);
- while (_queued_full_in_memory > _maximum_frames_in_memory) {
+ while (_queue.size() > _maximum_queue_size) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
{
boost::mutex::scoped_lock lock (_state_mutex);
- while (_queued_full_in_memory > _maximum_frames_in_memory) {
+ while (_queue.size() > _maximum_queue_size) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
}
lock.lock ();
+ _full_condition.notify_all ();
}
while (_queued_full_in_memory > _maximum_frames_in_memory) {
lock.lock ();
i->encoded.reset ();
--_queued_full_in_memory;
+ _full_condition.notify_all ();
}
-
- /* The queue has probably just gone down a bit; notify anything wait()ing on _full_condition */
- _full_condition.notify_all ();
}
}
catch (...)
Writer::set_encoder_threads (int threads)
{
_maximum_frames_in_memory = lrint (threads * Config::instance()->frames_in_memory_multiplier());
+ _maximum_queue_size = lrint (threads * 16);
}
void