filter/convert: convert_filter_new() returns std::unique_ptr

This commit is contained in:
Max Kellermann 2020-11-04 16:46:24 +01:00
parent f2b9785a67
commit 84f772357e
3 changed files with 5 additions and 5 deletions

View File

@ -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),

View File

@ -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

View File

@ -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);