Ignore FFmpeg warnings in a nicer way.
[dcpomatic.git] / src / lib / encode_server.cc
index 8db3f867cc09f34fe97e4f040c1e576f123070a0..61e0b09c58f1a340460791c02c7ead7aef417b8a 100644 (file)
 #include "dcpomatic_log.h"
 #include "encoded_log_entry.h"
 #include "version.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/foreach.hpp>
@@ -87,14 +90,9 @@ EncodeServer::~EncodeServer ()
                _full_condition.notify_all ();
        }
 
-       BOOST_FOREACH (boost::thread* i, _worker_threads) {
-               try {
-                       i->join ();
-               } catch (...) {
-
-               }
-               delete i;
-       }
+       try {
+               _worker_threads.join_all ();
+       } catch (...) {}
 
        {
                boost::mutex::scoped_lock lm (_broadcast.mutex);
@@ -241,8 +239,7 @@ EncodeServer::run ()
        }
 
        for (int i = 0; i < _num_threads; ++i) {
-               boost::thread* t = new thread(bind(&EncodeServer::worker_thread, this));
-               _worker_threads.push_back (t);
+               boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
 #ifdef DCPOMATIC_LINUX
                pthread_setname_np (t->native_handle(), "encode-server-worker");
 #endif