Fix server/client with non-RGB24 images.
[dcpomatic.git] / src / lib / image_proxy.cc
index 618cdbcf3ccb5183bf957c0ee504c045b30911c1..4e2f8a1354f9d8ccbc8b6f9cf1de5905935758cd 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