From 8b327f1d9bb5649df69f9547e38bcdcbfd416de1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 24 Mar 2019 22:42:06 +0100 Subject: [PATCH] filter/AutoConvert: implement Flush() --- src/filter/plugins/AutoConvertFilterPlugin.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/filter/plugins/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx index 08302cc00..accce87f2 100644 --- a/src/filter/plugins/AutoConvertFilterPlugin.cxx +++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx @@ -56,6 +56,7 @@ public: } ConstBuffer FilterPCM(ConstBuffer src) override; + ConstBuffer Flush() override; }; class PreparedAutoConvertFilter final : public PreparedFilter { @@ -104,6 +105,18 @@ AutoConvertFilter::FilterPCM(ConstBuffer src) return filter->FilterPCM(src); } +ConstBuffer +AutoConvertFilter::Flush() +{ + if (convert != nullptr) { + auto result = convert->Flush(); + if (!result.IsNull()) + return filter->FilterPCM(result); + } + + return filter->Flush(); +} + std::unique_ptr autoconvert_filter_new(std::unique_ptr filter) noexcept {