filter/AutoConvert: implement Flush()
This commit is contained in:
parent
aef0507abb
commit
8b327f1d9b
@ -56,6 +56,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override;
|
ConstBuffer<void> FilterPCM(ConstBuffer<void> src) override;
|
||||||
|
ConstBuffer<void> Flush() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PreparedAutoConvertFilter final : public PreparedFilter {
|
class PreparedAutoConvertFilter final : public PreparedFilter {
|
||||||
@ -104,6 +105,18 @@ AutoConvertFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return filter->FilterPCM(src);
|
return filter->FilterPCM(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConstBuffer<void>
|
||||||
|
AutoConvertFilter::Flush()
|
||||||
|
{
|
||||||
|
if (convert != nullptr) {
|
||||||
|
auto result = convert->Flush();
|
||||||
|
if (!result.IsNull())
|
||||||
|
return filter->FilterPCM(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter->Flush();
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<PreparedFilter>
|
std::unique_ptr<PreparedFilter>
|
||||||
autoconvert_filter_new(std::unique_ptr<PreparedFilter> filter) noexcept
|
autoconvert_filter_new(std::unique_ptr<PreparedFilter> filter) noexcept
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user