Commit 59ac9d39 authored by Max Kellermann's avatar Max Kellermann

output/recorder: move encoder_finish() call to destructor

parent ec41caad
...@@ -56,8 +56,14 @@ struct RecorderOutput { ...@@ -56,8 +56,14 @@ struct RecorderOutput {
RecorderOutput() RecorderOutput()
:base(recorder_output_plugin), :base(recorder_output_plugin),
encoder(nullptr),
path(AllocatedPath::Null()) {} path(AllocatedPath::Null()) {}
~RecorderOutput() {
if (encoder != nullptr)
encoder_finish(encoder);
}
bool Initialize(const config_param &param, Error &error_r) { bool Initialize(const config_param &param, Error &error_r) {
return base.Configure(param, error_r); return base.Configure(param, error_r);
} }
...@@ -133,15 +139,6 @@ RecorderOutput::Create(const config_param &param, Error &error) ...@@ -133,15 +139,6 @@ RecorderOutput::Create(const config_param &param, Error &error)
return recorder; return recorder;
} }
static void
recorder_output_finish(AudioOutput *ao)
{
RecorderOutput *recorder = (RecorderOutput *)ao;
encoder_finish(recorder->encoder);
delete recorder;
}
inline bool inline bool
RecorderOutput::EncoderToFile(Error &error) RecorderOutput::EncoderToFile(Error &error)
{ {
...@@ -241,7 +238,7 @@ const struct AudioOutputPlugin recorder_output_plugin = { ...@@ -241,7 +238,7 @@ const struct AudioOutputPlugin recorder_output_plugin = {
"recorder", "recorder",
nullptr, nullptr,
&Wrapper::Init, &Wrapper::Init,
recorder_output_finish, &Wrapper::Finish,
nullptr, nullptr,
nullptr, nullptr,
&Wrapper::Open, &Wrapper::Open,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment