pcm/PcmConvert: eliminate Open() and Close()

Let the constructor and destructor do this.  This means that all users
have to be converted to allocate PcmConvert dynamically.
This commit is contained in:
Max Kellermann
2019-04-04 20:55:39 +02:00
parent 00b04468dc
commit e78d825059
9 changed files with 53 additions and 99 deletions

View File

@@ -18,6 +18,7 @@
*/
#include "ConfigGlue.hxx"
#include "pcm/PcmConvert.hxx"
#include "lib/chromaprint/DecoderClient.hxx"
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"

View File

@@ -53,8 +53,7 @@ try {
const size_t in_frame_size = in_audio_format.GetFrameSize();
PcmConvert state;
state.Open(in_audio_format, out_audio_format);
PcmConvert state(in_audio_format, out_audio_format);
StaticFifoBuffer<uint8_t, 4096> buffer;
@@ -94,8 +93,6 @@ try {
output.size);
}
state.Close();
return EXIT_SUCCESS;
} catch (...) {
PrintException(std::current_exception());