Remove unnecessary Film variable in ContentPart.
[dcpomatic.git] / src / lib / image_content.cc
index 57212c589155e699d93a5528d7a02dd5d294dbb4..6d1738419bab10287a9df5149d2d31bec911a255 100644 (file)
@@ -41,7 +41,7 @@ using boost::shared_ptr;
 ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path p)
        : Content (film)
 {
-       video.reset (new VideoContent (this, film));
+       video.reset (new VideoContent (this));
 
        if (boost::filesystem::is_regular_file (p) && valid_image_file (p)) {
                _paths.push_back (p);
@@ -66,7 +66,7 @@ ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path
 ImageContent::ImageContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
        : Content (film, node)
 {
-       video.reset (new VideoContent (this, film, node, version));
+       video = VideoContent::from_xml (this, node, version);
 }
 
 string
@@ -103,7 +103,10 @@ ImageContent::as_xml (xmlpp::Node* node) const
 {
        node->add_child("Type")->add_child_text ("Image");
        Content::as_xml (node);
-       video->as_xml (node);
+
+       if (video) {
+               video->as_xml (node);
+       }
 }
 
 void