diff options
author | Max Kellermann <max@duempel.org> | 2013-10-19 18:48:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-19 18:48:38 +0200 |
commit | ff626ac76357940b2f0ac5cb243a68ac13df0f8a (patch) | |
tree | 493888a28950f75f5e254c0ded9dc9703ee83dc3 /src/DecoderInternal.cxx | |
parent | 59f8144c50765189594d5932fc25869f9ea6e265 (diff) | |
download | mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.gz mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.tar.xz mpd-ff626ac76357940b2f0ac5cb243a68ac13df0f8a.zip |
*: use references instead of pointers
Diffstat (limited to '')
-rw-r--r-- | src/DecoderInternal.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx index 43536686b..8d89155cc 100644 --- a/src/DecoderInternal.cxx +++ b/src/DecoderInternal.cxx @@ -42,17 +42,17 @@ decoder::~decoder() * one. */ static DecoderCommand -need_chunks(struct decoder_control *dc, bool do_wait) +need_chunks(decoder_control &dc, bool do_wait) { - if (dc->command == DecoderCommand::STOP || - dc->command == DecoderCommand::SEEK) - return dc->command; + if (dc.command == DecoderCommand::STOP || + dc.command == DecoderCommand::SEEK) + return dc.command; if (do_wait) { - dc->Wait(); - dc->client_cond.signal(); + dc.Wait(); + dc.client_cond.signal(); - return dc->command; + return dc.command; } return DecoderCommand::NONE; @@ -61,7 +61,7 @@ need_chunks(struct decoder_control *dc, bool do_wait) struct music_chunk * decoder_get_chunk(struct decoder *decoder) { - struct decoder_control *dc = decoder->dc; + decoder_control &dc = decoder->dc; DecoderCommand cmd; assert(decoder != nullptr); @@ -70,7 +70,7 @@ decoder_get_chunk(struct decoder *decoder) return decoder->chunk; do { - decoder->chunk = dc->buffer->Allocate(); + decoder->chunk = dc.buffer->Allocate(); if (decoder->chunk != nullptr) { decoder->chunk->replay_gain_serial = decoder->replay_gain_serial; @@ -81,9 +81,9 @@ decoder_get_chunk(struct decoder *decoder) return decoder->chunk; } - dc->Lock(); + dc.Lock(); cmd = need_chunks(dc, true); - dc->Unlock(); + dc.Unlock(); } while (cmd == DecoderCommand::NONE); return nullptr; @@ -92,15 +92,15 @@ decoder_get_chunk(struct decoder *decoder) void decoder_flush_chunk(struct decoder *decoder) { - struct decoder_control *dc = decoder->dc; + decoder_control &dc = decoder->dc; assert(decoder != nullptr); assert(decoder->chunk != nullptr); if (decoder->chunk->IsEmpty()) - dc->buffer->Return(decoder->chunk); + dc.buffer->Return(decoder->chunk); else - dc->pipe->Push(decoder->chunk); + dc.pipe->Push(decoder->chunk); decoder->chunk = nullptr; } |