aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/FLACCommon.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-02 19:47:31 +0200
committerMax Kellermann <max@duempel.org>2012-10-02 19:47:31 +0200
commitc9e700f07928b4a7dd34b8fdd2a00c226fd9b0b4 (patch)
tree1efc17fc0611d4cf132831b9c2215631aebf3d40 /src/decoder/FLACCommon.cxx
parent3c2d73d161814a1cac543f2623671feb0b7c8fe9 (diff)
downloadmpd-c9e700f07928b4a7dd34b8fdd2a00c226fd9b0b4.tar.gz
mpd-c9e700f07928b4a7dd34b8fdd2a00c226fd9b0b4.tar.xz
mpd-c9e700f07928b4a7dd34b8fdd2a00c226fd9b0b4.zip
decoder/flac: add ctor/dtor to struct flac_data
Diffstat (limited to 'src/decoder/FLACCommon.cxx')
-rw-r--r--src/decoder/FLACCommon.cxx31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/decoder/FLACCommon.cxx b/src/decoder/FLACCommon.cxx
index 46bcb357a..ed9245100 100644
--- a/src/decoder/FLACCommon.cxx
+++ b/src/decoder/FLACCommon.cxx
@@ -34,31 +34,22 @@ extern "C" {
#include <assert.h>
-void
-flac_data_init(struct flac_data *data, struct decoder * decoder,
- struct input_stream *input_stream)
+flac_data::flac_data(struct decoder *_decoder,
+ struct input_stream *_input_stream)
+ :initialized(false), unsupported(false),
+ total_frames(0), first_frame(0), next_frame(0), position(0),
+ decoder(_decoder), input_stream(_input_stream),
+ tag(nullptr)
{
- pcm_buffer_init(&data->buffer);
-
- data->unsupported = false;
- data->initialized = false;
- data->total_frames = 0;
- data->first_frame = 0;
- data->next_frame = 0;
-
- data->position = 0;
- data->decoder = decoder;
- data->input_stream = input_stream;
- data->tag = nullptr;
+ pcm_buffer_init(&buffer);
}
-void
-flac_data_deinit(struct flac_data *data)
+flac_data::~flac_data()
{
- pcm_buffer_deinit(&data->buffer);
+ pcm_buffer_deinit(&buffer);
- if (data->tag != nullptr)
- tag_free(data->tag);
+ if (tag != nullptr)
+ tag_free(tag);
}
static enum sample_format