summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-08 00:59:42 +0100
committerCarl Hetherington <cth@carlh.net>2023-11-20 07:34:23 +0100
commit83a948956916abb7b2c13c25141323d326b38708 (patch)
tree83bbeba8d94aa9c49dc248fdf54ff2a854f64d87 /src/lib/ffmpeg_content.cc
parentbb3a9a12116a4b2a5bc1fef38e73853f576a773a (diff)
Cleanup: handle Filter objects by value rather than by reference.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 6681a4f0a..ceebb5572 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -115,9 +115,8 @@ FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>
}
for (auto i: node->node_children("Filter")) {
- Filter const * f = Filter::from_id(i->content());
- if (f) {
- _filters.push_back (f);
+ if (auto filter = Filter::from_id(i->content())) {
+ _filters.push_back(*filter);
} else {
notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
}
@@ -232,7 +231,7 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
}
for (auto i: _filters) {
- node->add_child("Filter")->add_child_text(i->id());
+ node->add_child("Filter")->add_child_text(i.id());
}
if (_first_video) {
@@ -292,12 +291,12 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
if (examiner->rotation()) {
auto rot = *examiner->rotation ();
if (fabs (rot - 180) < 1.0) {
- _filters.push_back (Filter::from_id ("vflip"));
- _filters.push_back (Filter::from_id ("hflip"));
+ _filters.push_back(*Filter::from_id("vflip"));
+ _filters.push_back(*Filter::from_id("hflip"));
} else if (fabs (rot - 90) < 1.0) {
- _filters.push_back (Filter::from_id ("90clock"));
+ _filters.push_back(*Filter::from_id("90clock"));
} else if (fabs (rot - 270) < 1.0) {
- _filters.push_back (Filter::from_id ("90anticlock"));
+ _filters.push_back(*Filter::from_id("90anticlock"));
}
}
}
@@ -455,7 +454,7 @@ FFmpegContent::approximate_length () const
void
-FFmpegContent::set_filters (vector<Filter const *> const & filters)
+FFmpegContent::set_filters(vector<Filter> const& filters)
{
ContentChangeSignaller cc (this, FFmpegContentProperty::FILTERS);
@@ -486,7 +485,7 @@ FFmpegContent::identifier () const
}
for (auto i: _filters) {
- s += "_" + i->id();
+ s += "_" + i.id();
}
return s;