void
Encoder::begin ()
{
- if (!EncodeServerFinder::instance()->disabled ()) {
- weak_ptr<Encoder> wp = shared_from_this ();
- _server_found_connection = EncodeServerFinder::instance()->ServersListChanged.connect (
- boost::bind (&Encoder::call_servers_list_changed, wp)
- );
- }
+ weak_ptr<Encoder> wp = shared_from_this ();
+ _server_found_connection = EncodeServerFinder::instance()->ServersListChanged.connect (
+ boost::bind (&Encoder::call_servers_list_changed, wp)
+ );
}
/* We don't want the servers-list-changed callback trying to do things
boost::mutex::scoped_lock queue_lock (_queue_mutex);
- /* Wait until the queue has gone down a bit */
- while (_queue.size() >= threads * 2) {
- LOG_TIMING ("decoder-sleep queue=%1", _queue.size());
+ /* Wait until the queue has gone down a bit. Allow one thing in the queue even
+ when there are no threads.
+ */
+ while (_queue.size() >= (threads * 2) + 1) {
+ LOG_TIMING ("decoder-sleep queue=%1 threads=%2", _queue.size(), threads);
_full_condition.wait (queue_lock);
- LOG_TIMING ("decoder-wake queue=%1", _queue.size());
+ LOG_TIMING ("decoder-wake queue=%1 threads=%2", _queue.size(), threads);
}
_writer->rethrow ();
LOG_TIMING ("encoder-wake thread=%1 queue=%2", boost::this_thread::get_id(), _queue.size());
shared_ptr<DCPVideo> vf = _queue.front ();
- LOG_TIMING ("encoder-pop thread=%1 frame=%2 eyes=%3", boost::this_thread::get_id(), vf->index(), vf->eyes ());
+ LOG_TIMING ("encoder-pop thread=%1 frame=%2 eyes=%3", boost::this_thread::get_id(), vf->index(), (int) vf->eyes ());
_queue.pop_front ();
lock.unlock ();