summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-11-04 16:46:24 +0100
committerMax Kellermann <max@musicpd.org>2020-11-04 16:47:11 +0100
commit84f772357eb2582e28da6af04665a093ee468f0b (patch)
tree1d77dbb2501289868d1651c0535dd396d79dbf08 /src
parentf2b9785a6706234d9c804a277f614a3f138eb171 (diff)
filter/convert: convert_filter_new() returns std::unique_ptr
Diffstat (limited to 'src')
-rw-r--r--src/filter/plugins/AutoConvertFilterPlugin.cxx4
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.cxx4
-rw-r--r--src/filter/plugins/ConvertFilterPlugin.hxx2
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<AutoConvertFilter>(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<PreparedConvertFilter>();
}
-Filter *
+std::unique_ptr<Filter>
convert_filter_new(const AudioFormat in_audio_format,
const AudioFormat out_audio_format)
{
std::unique_ptr<ConvertFilter> 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<PreparedFilter>
convert_filter_prepare() noexcept;
-Filter *
+std::unique_ptr<Filter>
convert_filter_new(AudioFormat in_audio_format,
AudioFormat out_audio_format);