diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-06 20:42:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-06 20:42:12 +0100 |
| commit | 43877eccbedc0950ab253e76dd0cea691fd7a4b0 (patch) | |
| tree | 8b2e1b6d54a07d12b2842bd1c6a362b8e8b22c6d /src/lib/encoder.cc | |
| parent | 3b970d4c3089bbf7ca2c7f59d8d18142ed49de65 (diff) | |
| parent | 52fba4ddf170de2e073d1c4736b9407bad525290 (diff) | |
Merge branch '2.0' of ssh://git.carlh.net/home/carl/git/dcpomatic2 into 2.0
Diffstat (limited to 'src/lib/encoder.cc')
| -rw-r--r-- | src/lib/encoder.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index c3ad08441..07c97c674 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -36,6 +36,7 @@ #include "data.h" #include <libcxml/cxml.h> #include <boost/lambda/lambda.hpp> +#include <boost/foreach.hpp> #include <iostream> #include "i18n.h" @@ -66,7 +67,7 @@ Encoder::Encoder (shared_ptr<const Film> film, weak_ptr<Job> j, shared_ptr<Write , _terminate (false) , _writer (writer) { - + servers_list_changed (); } Encoder::~Encoder () @@ -99,7 +100,7 @@ Encoder::begin () _writer->set_encoder_threads (_threads.size ()); if (!ServerFinder::instance()->disabled ()) { - _server_found_connection = ServerFinder::instance()->connect (boost::bind (&Encoder::server_found, this, _1)); + _server_found_connection = ServerFinder::instance()->ServersListChanged.connect (boost::bind (&Encoder::servers_list_changed, this)); } } @@ -271,6 +272,7 @@ Encoder::terminate_threads () } _threads.clear (); + _terminate = false; } void @@ -362,7 +364,10 @@ catch (...) } void -Encoder::server_found (ServerDescription s) +Encoder::servers_list_changed () { - add_worker_threads (s); + terminate_threads (); + BOOST_FOREACH (ServerDescription i, ServerFinder::instance()->servers ()) { + add_worker_threads (i); + } } |
