Merge master.
[dcpomatic.git] / src / lib / server.cc
index c4c98a4c9f0ea6da1106e1c3f3b46dad959883c4..59364fadd65aba787d1bfac5579c581eeba9a4c2 100644 (file)
@@ -29,7 +29,7 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
 #include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/raw_convert.h>
 #include "server.h"
 #include "util.h"
 #include "scaler.h"
 
 #include "i18n.h"
 
-#define LOG_GENERAL(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::GENERAL);
-#define LOG_GENERAL_NC(...) _log->microsecond_log (__VA_ARGS__, Log::GENERAL);
-#define LOG_ERROR(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::ERROR);
-#define LOG_ERROR_NC(...) _log->microsecond_log (__VA_ARGS__, Log::ERROR);
+#define LOG_GENERAL(...)    _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
+#define LOG_GENERAL_NC(...) _log->log (__VA_ARGS__, Log::TYPE_GENERAL);
+#define LOG_ERROR(...)      _log->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR);
+#define LOG_ERROR_NC(...)   _log->log (__VA_ARGS__, Log::TYPE_ERROR);
 
 using std::string;
 using std::stringstream;
@@ -62,8 +62,8 @@ using boost::thread;
 using boost::bind;
 using boost::scoped_array;
 using boost::optional;
-using libdcp::Size;
-using libdcp::raw_convert;
+using dcp::Size;
+using dcp::raw_convert;
 
 Server::Server (shared_ptr<Log> log, bool verbose)
        : _log (log)
@@ -104,6 +104,7 @@ Server::process (shared_ptr<Socket> socket, struct timeval& after_read, struct t
        try {
                encoded->send (socket);
        } catch (std::exception& e) {
+               cerr << "Send failed; frame " << dcp_video_frame.index() << "\n";
                LOG_ERROR ("Send failed; frame %1", dcp_video_frame.index());
                throw;
        }
@@ -139,6 +140,7 @@ Server::worker_thread ()
                        frame = process (socket, after_read, after_encode);
                        ip = socket->socket().remote_endpoint().address().to_string();
                } catch (std::exception& e) {
+                       cerr << "Error: " << e.what() << "\n";
                        LOG_ERROR ("Error: %1", e.what());
                }