summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-22 20:33:34 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-18 00:41:34 +0100
commit0f9dc78d7da4f96dbbfbd692c19f74de72098351 (patch)
treec6ad4ceee12d3ed675b19e6d3a5aee55213289cd
parent9f646cd41ced9bf6f2e6fd735f92fae3aff1d6db (diff)
Cleanup: swap a list for a vector.
-rw-r--r--src/lib/content.h2
-rw-r--r--src/lib/dcp_content.cc2
-rw-r--r--src/lib/text_content.cc11
-rw-r--r--src/lib/text_content.h2
4 files changed, 9 insertions, 8 deletions
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<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;
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<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);
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 <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)
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<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;