summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-08-03 07:48:50 +0200
committerMax Kellermann <max@musicpd.org>2019-08-03 07:52:51 +0200
commit00830a20e3231460bf8927844fd6fed0ddad5c0a (patch)
treef7a7c9436ebbba3c3882c3a649ba83817954969a /src/decoder
parentd39d2874b4642f55f9fd0c959d34eb15fe8ee972 (diff)
decoder/mad: convert to class, make almost everything private
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/plugins/MadDecoderPlugin.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx
index f30c3d7ae..8bddf14be 100644
--- a/src/decoder/plugins/MadDecoderPlugin.cxx
+++ b/src/decoder/plugins/MadDecoderPlugin.cxx
@@ -106,7 +106,7 @@ mad_plugin_init(const ConfigBlock &block)
return true;
}
-struct MadDecoder {
+class MadDecoder {
static constexpr size_t READ_BUFFER_SIZE = 40960;
static constexpr size_t MP3_DATA_OUTPUT_BUFFER_SIZE = 2048;
@@ -136,12 +136,14 @@ struct MadDecoder {
InputStream &input_stream;
enum mad_layer layer = mad_layer(0);
+public:
MadDecoder(DecoderClient *client, InputStream &input_stream) noexcept;
~MadDecoder() noexcept;
void RunDecoder() noexcept;
bool RunScan(TagHandler &handler) noexcept;
+private:
bool Seek(long offset) noexcept;
bool FillBuffer() noexcept;
void ParseId3(size_t tagsize, Tag *tag) noexcept;