Support building of cli-only .deb packages (#2066).
[dcpomatic.git] / src / tools / dcpomatic_server_cli.cc
index fa13ebb5fb8770fae62d16ccb898cebfa00da282..6d7f6aba729ae06113de78f76ae9bbd5ab8dba68 100644 (file)
@@ -28,6 +28,7 @@
 #include "lib/null_log.h"
 #include "lib/version.h"
 #include "lib/encode_server.h"
+#include "lib/dcpomatic_log.h"
 #include <boost/array.hpp>
 #include <boost/asio.hpp>
 #include <boost/algorithm/string.hpp>
@@ -45,7 +46,7 @@
 using std::cerr;
 using std::string;
 using std::cout;
-using boost::shared_ptr;
+using std::shared_ptr;
 
 static void
 help (string n)
@@ -64,7 +65,7 @@ main (int argc, char* argv[])
        dcpomatic_setup_path_encoding ();
        dcpomatic_setup ();
 
-       int num_threads = Config::instance()->num_local_encoding_threads ();
+       int num_threads = Config::instance()->server_encoding_threads ();
        bool verbose = false;
        bool write_log = false;
 
@@ -104,14 +105,11 @@ main (int argc, char* argv[])
                }
        }
 
-       shared_ptr<Log> log;
        if (write_log) {
-               log.reset (new FileLog ("dcpomatic_server_cli.log"));
-       } else {
-               log.reset (new NullLog);
+               dcpomatic_log.reset (new FileLog("dcpomatic_server_cli.log"));
        }
 
-       EncodeServer server (log, verbose, num_threads);
+       EncodeServer server (verbose, num_threads);
 
        try {
                server.run ();