Centos build fixes.
[dcpomatic.git] / src / lib / image_proxy.cc
index 618cdbcf3ccb5183bf957c0ee504c045b30911c1..ba572c72733e9c636a37575ca5cc04d6c609891b 100644 (file)
@@ -55,7 +55,7 @@ RawImageProxy::RawImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> soc
                xml->number_child<int> ("Width"), xml->number_child<int> ("Height")
                );
 
-       _image.reset (new Image (PIX_FMT_RGB24, size, true));
+       _image.reset (new Image (static_cast<AVPixelFormat> (xml->number_child<int> ("PixelFormat")), size, true));
        _image->read_from_socket (socket);
 }
 
@@ -71,6 +71,7 @@ RawImageProxy::add_metadata (xmlpp::Node* node) const
        node->add_child("Type")->add_child_text (N_("Raw"));
        node->add_child("Width")->add_child_text (libdcp::raw_convert<string> (_image->size().width));
        node->add_child("Height")->add_child_text (libdcp::raw_convert<string> (_image->size().height));
+       node->add_child("PixelFormat")->add_child_text (libdcp::raw_convert<string> (_image->pixel_format ()));
 }
 
 void
@@ -141,6 +142,8 @@ MagickImageProxy::image () const
                p += _image->stride()[0];
        }
 
+       delete magick_image;
+
        LOG_TIMING ("[%1] MagickImageProxy completes decode and convert of %2 bytes", boost::this_thread::get_id(), _blob.length());
 
        return _image;