From 84f772357eb2582e28da6af04665a093ee468f0b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Nov 2020 16:46:24 +0100 Subject: [PATCH] filter/convert: convert_filter_new() returns std::unique_ptr --- src/filter/plugins/AutoConvertFilterPlugin.cxx | 4 ++-- src/filter/plugins/ConvertFilterPlugin.cxx | 4 ++-- src/filter/plugins/ConvertFilterPlugin.hxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filter/plugins/AutoConvertFilterPlugin.cxx b/src/filter/plugins/AutoConvertFilterPlugin.cxx index 54c692406..0fe11cff3 100644 --- a/src/filter/plugins/AutoConvertFilterPlugin.cxx +++ b/src/filter/plugins/AutoConvertFilterPlugin.cxx @@ -85,8 +85,8 @@ PreparedAutoConvertFilter::Open(AudioFormat &in_audio_format) if (in_audio_format != child_audio_format) { /* yes - create a convert_filter */ - convert.reset(convert_filter_new(in_audio_format, - child_audio_format)); + convert = convert_filter_new(in_audio_format, + child_audio_format); } return std::make_unique(std::move(new_filter), diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx index 91ddddeef..d04d09da6 100644 --- a/src/filter/plugins/ConvertFilterPlugin.cxx +++ b/src/filter/plugins/ConvertFilterPlugin.cxx @@ -117,13 +117,13 @@ convert_filter_prepare() noexcept return std::make_unique(); } -Filter * +std::unique_ptr convert_filter_new(const AudioFormat in_audio_format, const AudioFormat out_audio_format) { std::unique_ptr filter(new ConvertFilter(in_audio_format)); filter->Set(out_audio_format); - return filter.release(); + return filter; } void diff --git a/src/filter/plugins/ConvertFilterPlugin.hxx b/src/filter/plugins/ConvertFilterPlugin.hxx index a5299147e..0f78da519 100644 --- a/src/filter/plugins/ConvertFilterPlugin.hxx +++ b/src/filter/plugins/ConvertFilterPlugin.hxx @@ -29,7 +29,7 @@ struct AudioFormat; std::unique_ptr convert_filter_prepare() noexcept; -Filter * +std::unique_ptr convert_filter_new(AudioFormat in_audio_format, AudioFormat out_audio_format);