Cleanup: swap a list for a vector.
authorCarl Hetherington <cth@carlh.net>
Sun, 22 Jan 2023 19:33:34 +0000 (20:33 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Feb 2023 13:47:25 +0000 (14:47 +0100)
src/lib/content.h
src/lib/dcp_content.cc
src/lib/text_content.cc
src/lib/text_content.h

index 979680d6a796781b1d0d8e4fc95efa0eef325148..0ce87ed9be0a192ec6923036f724b9d33abe7cd0 100644 (file)
@@ -208,7 +208,7 @@ public:
 
        std::shared_ptr<VideoContent> video;
        std::shared_ptr<AudioContent> audio;
-       std::list<std::shared_ptr<TextContent>> text;
+       std::vector<std::shared_ptr<TextContent>> text;
        std::shared_ptr<AtmosContent> atmos;
 
        std::shared_ptr<TextContent> only_text () const;
index cdf104f0377ba3b2aee4d714effb0b2f2f1b7e24..231a93bd0bec27c37574b785428ca792a185ffbb 100644 (file)
@@ -258,7 +258,7 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                atmos->set_length (examiner->atmos_length());
        }
 
-       list<shared_ptr<TextContent>> new_text;
+       vector<shared_ptr<TextContent>> new_text;
 
        for (int i = 0; i < examiner->text_count(TextType::OPEN_SUBTITLE); ++i) {
                auto c = make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE);
index a85b271a88d23dbfca216491e5777e701c720f03..e4cbc601a0774716354538f354213fdfe354f93f 100644 (file)
@@ -81,9 +81,9 @@ TextContent::TextContent (Content* parent, TextType type, TextType original_type
 }
 
 /** @return TextContents from node or <Text> 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<shared_ptr<TextContent>>
+vector<shared_ptr<TextContent>>
 TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version, list<string>& notes)
 {
        if (version < 34) {
@@ -104,14 +104,15 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version, li
                return { make_shared<TextContent>(parent, node, version, notes) };
        }
 
-       list<shared_ptr<TextContent>> c;
+       vector<shared_ptr<TextContent>> content;
        for (auto i: node->node_children("Text")) {
-               c.push_back (make_shared<TextContent>(parent, i, version, notes));
+               content.push_back(make_shared<TextContent>(parent, i, version, notes));
        }
 
-       return c;
+       return content;
 }
 
+
 TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version, list<string>& notes)
        : ContentPart (parent)
        , _use (false)
index 7c060cd482afb76fa3bdd152bb8dd178c4d2350f..4d4bdc507e478043ca2111c2fa0507d812aaec8d 100644 (file)
@@ -199,7 +199,7 @@ public:
                return _language_is_additional;
        }
 
-       static std::list<std::shared_ptr<TextContent>> from_xml (Content* parent, cxml::ConstNodePtr, int version, std::list<std::string>& notes);
+       static std::vector<std::shared_ptr<TextContent>> from_xml(Content* parent, cxml::ConstNodePtr, int version, std::list<std::string>& notes);
 
 private:
        friend struct ffmpeg_pts_offset_test;