aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderInternal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 21:12:37 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 21:12:37 +0200
commit82059645f18e4a8aa734e0a376d10bb52fc1cc7d (patch)
treee2d1c113c887cdafe95ec07419150d6b768211b6 /src/DecoderInternal.cxx
parent13e9f18403b98f8123b1b983c4680957d684e47b (diff)
downloadmpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.tar.gz
mpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.tar.xz
mpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.zip
decoder: rename the struct to "Decoder"
Diffstat (limited to 'src/DecoderInternal.cxx')
-rw-r--r--src/DecoderInternal.cxx45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx
index 8d89155cc..c3ce6d433 100644
--- a/src/DecoderInternal.cxx
+++ b/src/DecoderInternal.cxx
@@ -27,7 +27,7 @@
#include <assert.h>
-decoder::~decoder()
+Decoder::~Decoder()
{
/* caller must flush the chunk */
assert(chunk == nullptr);
@@ -59,26 +59,24 @@ need_chunks(decoder_control &dc, bool do_wait)
}
struct music_chunk *
-decoder_get_chunk(struct decoder *decoder)
+decoder_get_chunk(Decoder &decoder)
{
- decoder_control &dc = decoder->dc;
+ decoder_control &dc = decoder.dc;
DecoderCommand cmd;
- assert(decoder != nullptr);
-
- if (decoder->chunk != nullptr)
- return decoder->chunk;
+ if (decoder.chunk != nullptr)
+ return decoder.chunk;
do {
- decoder->chunk = dc.buffer->Allocate();
- if (decoder->chunk != nullptr) {
- decoder->chunk->replay_gain_serial =
- decoder->replay_gain_serial;
- if (decoder->replay_gain_serial != 0)
- decoder->chunk->replay_gain_info =
- decoder->replay_gain_info;
-
- return decoder->chunk;
+ decoder.chunk = dc.buffer->Allocate();
+ if (decoder.chunk != nullptr) {
+ decoder.chunk->replay_gain_serial =
+ decoder.replay_gain_serial;
+ if (decoder.replay_gain_serial != 0)
+ decoder.chunk->replay_gain_info =
+ decoder.replay_gain_info;
+
+ return decoder.chunk;
}
dc.Lock();
@@ -90,17 +88,16 @@ decoder_get_chunk(struct decoder *decoder)
}
void
-decoder_flush_chunk(struct decoder *decoder)
+decoder_flush_chunk(Decoder &decoder)
{
- decoder_control &dc = decoder->dc;
+ decoder_control &dc = decoder.dc;
- assert(decoder != nullptr);
- assert(decoder->chunk != nullptr);
+ assert(decoder.chunk != nullptr);
- if (decoder->chunk->IsEmpty())
- dc.buffer->Return(decoder->chunk);
+ if (decoder.chunk->IsEmpty())
+ dc.buffer->Return(decoder.chunk);
else
- dc.pipe->Push(decoder->chunk);
+ dc.pipe->Push(decoder.chunk);
- decoder->chunk = nullptr;
+ decoder.chunk = nullptr;
}