From c75cb67c4406648314ce2a15daf8b632374d7913 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Jul 2013 08:10:10 +0200 Subject: pcm_buffer: convert to C++ --- src/decoder/FlacCommon.cxx | 5 +---- src/decoder/FlacCommon.hxx | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/FlacCommon.cxx b/src/decoder/FlacCommon.cxx index 07a377055..74a0347f2 100644 --- a/src/decoder/FlacCommon.cxx +++ b/src/decoder/FlacCommon.cxx @@ -39,13 +39,10 @@ flac_data::flac_data(struct decoder *_decoder, decoder(_decoder), input_stream(_input_stream), tag(nullptr) { - pcm_buffer_init(&buffer); } flac_data::~flac_data() { - pcm_buffer_deinit(&buffer); - if (tag != nullptr) tag_free(tag); } @@ -178,7 +175,7 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame, return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; size_t buffer_size = frame->header.blocksize * data->frame_size; - buffer = pcm_buffer_get(&data->buffer, buffer_size); + buffer = data->buffer.Get(buffer_size); flac_convert(buffer, frame->header.channels, (enum sample_format)data->audio_format.format, buf, diff --git a/src/decoder/FlacCommon.hxx b/src/decoder/FlacCommon.hxx index 78982e308..ca6c9a8f9 100644 --- a/src/decoder/FlacCommon.hxx +++ b/src/decoder/FlacCommon.hxx @@ -26,10 +26,7 @@ #include "FlacInput.hxx" #include "DecoderAPI.hxx" - -extern "C" { -#include "pcm/pcm_buffer.h" -} +#include "pcm/PcmBuffer.hxx" #include #include @@ -38,7 +35,7 @@ extern "C" { #define G_LOG_DOMAIN "flac" struct flac_data : public FlacInput { - struct pcm_buffer buffer; + PcmBuffer buffer; /** * The size of one frame in the output buffer. -- cgit v1.2.3