From: Carl Hetherington Date: Wed, 25 Jul 2018 12:54:10 +0000 (+0100) Subject: Fix problems with loading projects with captions / subs. X-Git-Tag: v2.13.39~1 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=d71cf1ae31c7d488c95cd63278b200035e4d6a63;p=dcpomatic.git Fix problems with loading projects with captions / subs. --- diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 761ffc6b7..7c3c27d45 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -73,7 +73,7 @@ TextContent::TextContent (Content* parent, TextType type, TextType original_type } -/** @return TextContents from node or nodes under node (according to version). +/** @return TextContents from node or nodes under node (according to version). * The list could be empty if no TextContents are found. */ list > @@ -99,12 +99,12 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) return c; } - if (!node->optional_node_child("Caption")) { + if (!node->optional_node_child("Text")) { return list >(); } list > c; - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Caption")) { + BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Text")) { c.push_back (shared_ptr (new TextContent (parent, i, version))); } return c; diff --git a/src/lib/types.cc b/src/lib/types.cc index b193ac9cf..898abeca4 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -100,7 +100,7 @@ string_to_text_type (string s) return TEXT_UNKNOWN; } else if (s == "open-subtitle") { return TEXT_OPEN_SUBTITLE; - } else if (s == "closed") { + } else if (s == "closed-caption") { return TEXT_CLOSED_CAPTION; } else { throw MetadataError (String::compose ("Unknown text type %1", s));