Fix server/client with non-RGB24 images.
authorCarl Hetherington <cth@carlh.net>
Tue, 10 Jun 2014 09:24:06 +0000 (10:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 10 Jun 2014 09:24:06 +0000 (10:24 +0100)
ChangeLog
src/lib/image_proxy.cc

index c03d54e9aaf68e31ca6bbe8755b6432295a79667..a402353d362c48f365291d38192d056369200838 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-06-09  Carl Hetherington  <cth@carlh.net>
 
+       * Fix server/client with non-RGB24 sources.
+
        * Make audio gain a floating-point value in the UI (#367).
 
        * Work-around out-of-memory crashes with large start trims (#252).
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