Get ccaps by asking the Player, rather than by listening to its emissions,
[dcpomatic.git] / src / lib / caption_content.cc
index 368d276d93abfbc893829206a82cba4d5cf46366..bbb1bacf3d7a3eb6acb7efd7224890839db6b506 100644 (file)
@@ -57,7 +57,7 @@ int const CaptionContentProperty::FADE_OUT = 513;
 int const CaptionContentProperty::OUTLINE_WIDTH = 514;
 int const CaptionContentProperty::TYPE = 515;
 
-CaptionContent::CaptionContent (Content* parent)
+CaptionContent::CaptionContent (Content* parent, CaptionType original_type)
        : ContentPart (parent)
        , _use (false)
        , _burn (false)
@@ -67,8 +67,8 @@ CaptionContent::CaptionContent (Content* parent)
        , _y_scale (1)
        , _line_spacing (1)
        , _outline_width (2)
-       , _type (CAPTION_OPEN)
-       , _original_type (CAPTION_OPEN)
+       , _type (original_type)
+       , _original_type (original_type)
 {
 
 }
@@ -99,7 +99,7 @@ CaptionContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version)
                return c;
        }
 
-       if (!node->node_child("Caption")) {
+       if (!node->optional_node_child("Caption")) {
                return list<shared_ptr<CaptionContent> >();
        }