From: Carl Hetherington Date: Sun, 22 Jan 2023 19:33:34 +0000 (+0100) Subject: Cleanup: swap a list for a vector. X-Git-Tag: v2.16.45~18^2~1 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=c291a92c51be6ad9ee6c43bd0ec93aec06ac981c;hp=0d87795d5305db9d75894ba9857662b1c0cfeeb3;p=dcpomatic.git Cleanup: swap a list for a vector. --- diff --git a/src/lib/content.h b/src/lib/content.h index 979680d6a..0ce87ed9b 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -208,7 +208,7 @@ public: std::shared_ptr video; std::shared_ptr audio; - std::list> text; + std::vector> text; std::shared_ptr atmos; std::shared_ptr only_text () const; diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index cdf104f03..231a93bd0 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -258,7 +258,7 @@ DCPContent::examine (shared_ptr film, shared_ptr job) atmos->set_length (examiner->atmos_length()); } - list> new_text; + vector> new_text; for (int i = 0; i < examiner->text_count(TextType::OPEN_SUBTITLE); ++i) { auto c = make_shared(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE); diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index a85b271a8..e4cbc601a 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -81,9 +81,9 @@ TextContent::TextContent (Content* parent, TextType type, TextType original_type } /** @return TextContents from node or nodes under node (according to version). - * The list could be empty if no TextContents are found. + * The vector could be empty if no TextContents are found. */ -list> +vector> TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version, list& notes) { if (version < 34) { @@ -104,14 +104,15 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version, li return { make_shared(parent, node, version, notes) }; } - list> c; + vector> content; for (auto i: node->node_children("Text")) { - c.push_back (make_shared(parent, i, version, notes)); + content.push_back(make_shared(parent, i, version, notes)); } - return c; + return content; } + TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version, list& notes) : ContentPart (parent) , _use (false) diff --git a/src/lib/text_content.h b/src/lib/text_content.h index 7c060cd48..4d4bdc507 100644 --- a/src/lib/text_content.h +++ b/src/lib/text_content.h @@ -199,7 +199,7 @@ public: return _language_is_additional; } - static std::list> from_xml (Content* parent, cxml::ConstNodePtr, int version, std::list& notes); + static std::vector> from_xml(Content* parent, cxml::ConstNodePtr, int version, std::list& notes); private: friend struct ffmpeg_pts_offset_test;