filter/convert: convert_filter_new() returns std::unique_ptr
This commit is contained in:
parent
f2b9785a67
commit
84f772357e
@ -85,8 +85,8 @@ PreparedAutoConvertFilter::Open(AudioFormat &in_audio_format)
|
|||||||
if (in_audio_format != child_audio_format) {
|
if (in_audio_format != child_audio_format) {
|
||||||
/* yes - create a convert_filter */
|
/* yes - create a convert_filter */
|
||||||
|
|
||||||
convert.reset(convert_filter_new(in_audio_format,
|
convert = convert_filter_new(in_audio_format,
|
||||||
child_audio_format));
|
child_audio_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_unique<AutoConvertFilter>(std::move(new_filter),
|
return std::make_unique<AutoConvertFilter>(std::move(new_filter),
|
||||||
|
@ -117,13 +117,13 @@ convert_filter_prepare() noexcept
|
|||||||
return std::make_unique<PreparedConvertFilter>();
|
return std::make_unique<PreparedConvertFilter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Filter *
|
std::unique_ptr<Filter>
|
||||||
convert_filter_new(const AudioFormat in_audio_format,
|
convert_filter_new(const AudioFormat in_audio_format,
|
||||||
const AudioFormat out_audio_format)
|
const AudioFormat out_audio_format)
|
||||||
{
|
{
|
||||||
std::unique_ptr<ConvertFilter> filter(new ConvertFilter(in_audio_format));
|
std::unique_ptr<ConvertFilter> filter(new ConvertFilter(in_audio_format));
|
||||||
filter->Set(out_audio_format);
|
filter->Set(out_audio_format);
|
||||||
return filter.release();
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -29,7 +29,7 @@ struct AudioFormat;
|
|||||||
std::unique_ptr<PreparedFilter>
|
std::unique_ptr<PreparedFilter>
|
||||||
convert_filter_prepare() noexcept;
|
convert_filter_prepare() noexcept;
|
||||||
|
|
||||||
Filter *
|
std::unique_ptr<Filter>
|
||||||
convert_filter_new(AudioFormat in_audio_format,
|
convert_filter_new(AudioFormat in_audio_format,
|
||||||
AudioFormat out_audio_format);
|
AudioFormat out_audio_format);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user