Add a comment.
[dcpomatic.git] / src / lib / raw_image_proxy.cc
index fb0d16df8a5b6cc29cef87a5054d85ccdc8dec5e..c606ddd9906520b128c1009517d2c706dd180659 100644 (file)
 
 #include "raw_image_proxy.h"
 #include "image.h"
-#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/util.h>
+#include <dcp/warnings.h>
 #include <libcxml/cxml.h>
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 
 #include "i18n.h"
 
@@ -45,7 +45,7 @@ using boost::optional;
 using dcp::raw_convert;
 
 
-RawImageProxy::RawImageProxy (shared_ptr<Image> image)
+RawImageProxy::RawImageProxy(shared_ptr<const Image> image)
        : _image (image)
 {
 
@@ -58,8 +58,9 @@ RawImageProxy::RawImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> soc
                xml->number_child<int>("Width"), xml->number_child<int>("Height")
                );
 
-       _image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, Image::Alignment::PADDED);
-       _image->read_from_socket (socket);
+       auto image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, Image::Alignment::PADDED);
+       image->read_from_socket (socket);
+       _image = image;
 }