decoder/flac: refactor flac_convert() to class FlacPcmImport

This commit is contained in:
Max Kellermann
2016-07-11 23:12:14 +02:00
parent b9de3270f6
commit 44219d5e91
4 changed files with 105 additions and 78 deletions

View File

@@ -25,19 +25,12 @@
#define MPD_FLAC_COMMON_HXX
#include "FlacInput.hxx"
#include "FlacPcm.hxx"
#include "../DecoderAPI.hxx"
#include "pcm/PcmBuffer.hxx"
#include <FLAC/stream_decoder.h>
struct FlacDecoder : public FlacInput {
PcmBuffer buffer;
/**
* The size of one frame in the output buffer.
*/
unsigned frame_size;
/**
* Has decoder_initialized() been called yet?
*/
@@ -48,11 +41,7 @@ struct FlacDecoder : public FlacInput {
*/
bool unsupported = false;
/**
* The validated audio format of the FLAC file. This
* attribute is defined if "initialized" is true.
*/
AudioFormat audio_format;
FlacPcmImport pcm_import;
/**
* End of last frame's position within the stream. This is
@@ -62,7 +51,6 @@ struct FlacDecoder : public FlacInput {
Tag tag;
FlacDecoder(Decoder &_decoder, InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder) {}