/*
Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
- This program is free software; you can redistribute it and/or modify
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ DCP-o-matic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
*/
#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
#include <boost/foreach.hpp>
+#include <boost/make_shared.hpp>
#include <string>
#include <vector>
#include <iostream>
using boost::bind;
using boost::scoped_array;
using boost::optional;
+using boost::make_shared;
using dcp::Size;
using dcp::Data;
{
{
boost::mutex::scoped_lock lm (_mutex);
+ _terminate = true;
_empty_condition.notify_all ();
_full_condition.notify_all ();
}
socket->read (reinterpret_cast<uint8_t*> (buffer.get()), length);
string s (buffer.get());
- shared_ptr<cxml::Document> xml (new cxml::Document ("EncodingRequest"));
+ shared_ptr<cxml::Document> xml = make_shared<cxml::Document> ("EncodingRequest");
xml->read_string (s);
/* This is a double-check; the server shouldn't even be on the candidate list
if it is the wrong version, but it doesn't hurt to make sure here.
return -1;
}
- shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket));
+ shared_ptr<PlayerVideo> pvf = make_shared<PlayerVideo> (xml, socket);
DCPVideo dcp_video_frame (pvf, xml, _log);
if (_verbose) {
cout << "Offering services to master " << _broadcast.send_endpoint.address().to_string () << "\n";
}
- shared_ptr<Socket> socket (new Socket);
+ shared_ptr<Socket> socket = make_shared<Socket> ();
try {
socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), Config::instance()->server_port_base() + 1));
socket->write (xml.length() + 1);