filter/chain: remove unused field ChainFilter::Child::name

This commit is contained in:
Max Kellermann 2020-11-04 16:26:03 +01:00
parent 6484af472b
commit 27c589da97

View File

@ -31,12 +31,10 @@
class ChainFilter final : public Filter { class ChainFilter final : public Filter {
struct Child { struct Child {
const char *name;
std::unique_ptr<Filter> filter; std::unique_ptr<Filter> filter;
Child(const char *_name, explicit Child(std::unique_ptr<Filter> &&_filter) noexcept
std::unique_ptr<Filter> _filter) noexcept :filter(std::move(_filter)) {}
:name(_name), filter(std::move(_filter)) {}
}; };
std::list<Child> children; std::list<Child> children;
@ -50,13 +48,12 @@ public:
explicit ChainFilter(AudioFormat _audio_format) explicit ChainFilter(AudioFormat _audio_format)
:Filter(_audio_format) {} :Filter(_audio_format) {}
void Append(const char *name, void Append(std::unique_ptr<Filter> filter) noexcept {
std::unique_ptr<Filter> filter) noexcept {
assert(out_audio_format.IsValid()); assert(out_audio_format.IsValid());
out_audio_format = filter->GetOutAudioFormat(); out_audio_format = filter->GetOutAudioFormat();
assert(out_audio_format.IsValid()); assert(out_audio_format.IsValid());
children.emplace_back(name, std::move(filter)); children.emplace_back(std::move(filter));
RewindFlush(); RewindFlush();
} }
@ -121,7 +118,7 @@ PreparedChainFilter::Open(AudioFormat &in_audio_format)
for (auto &child : children) { for (auto &child : children) {
AudioFormat audio_format = chain->GetOutAudioFormat(); AudioFormat audio_format = chain->GetOutAudioFormat();
chain->Append(child.name, child.Open(audio_format)); chain->Append(child.Open(audio_format));
} }
return chain; return chain;