X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fencoder.cc;h=7a0295e4c52dc9a85e7d20980cd7fa6840eb7eab;hb=e80732c66bb8907836eafeb816d695f96e063843;hp=6b520571a7430efd7f9a21636cf3d8402af2f827;hpb=228fbab81a5f093e9265d565c1110582c363def3;p=dcpomatic.git diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 6b520571a..7a0295e4c 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -84,6 +84,8 @@ Encoder::add_worker_threads (ServerDescription d) for (int i = 0; i < d.threads(); ++i) { _threads.push_back (new boost::thread (boost::bind (&Encoder::encoder_thread, this, d))); } + + _writer->set_encoder_threads (_threads.size ()); } void @@ -93,7 +95,11 @@ Encoder::begin () _threads.push_back (new boost::thread (boost::bind (&Encoder::encoder_thread, this, optional ()))); } - ServerFinder::instance()->connect (boost::bind (&Encoder::server_found, this, _1)); + _writer->set_encoder_threads (_threads.size ()); + + if (!ServerFinder::instance()->disabled ()) { + _server_found_connection = ServerFinder::instance()->connect (boost::bind (&Encoder::server_found, this, _1)); + } } void