aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mpc_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-11 21:39:50 +0100
committerMax Kellermann <max@duempel.org>2008-11-11 21:39:50 +0100
commit06c60888dc982ad66526fbe14aa21318e7d62958 (patch)
treee8f9d68cbd6d39c641664f567fd9cc60fd21ee1b /src/decoder/mpc_plugin.c
parent97080b796c3b7fe17b3758bab8c6a488ab0fa9c2 (diff)
downloadmpd-06c60888dc982ad66526fbe14aa21318e7d62958.tar.gz
mpd-06c60888dc982ad66526fbe14aa21318e7d62958.tar.xz
mpd-06c60888dc982ad66526fbe14aa21318e7d62958.zip
mpc: eliminated the local variable "eof"
Since each "eof=true" is followed by "break", the variable is superfluous.
Diffstat (limited to 'src/decoder/mpc_plugin.c')
-rw-r--r--src/decoder/mpc_plugin.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/decoder/mpc_plugin.c b/src/decoder/mpc_plugin.c
index 584b9fed6..2496f51a9 100644
--- a/src/decoder/mpc_plugin.c
+++ b/src/decoder/mpc_plugin.c
@@ -108,7 +108,6 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
- bool eof = false;
long ret;
#define MPC_CHUNK_SIZE 4096
char chunk[MPC_CHUNK_SIZE];
@@ -162,7 +161,7 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
inStream->seekable,
mpc_streaminfo_get_length(&info));
- while (!eof) {
+ while (true) {
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
samplePos = decoder_seek_where(mpd_decoder) *
audio_format.sample_rate;
@@ -179,10 +178,8 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
ret = mpc_decoder_decode(&decoder, sample_buffer,
&vbrUpdateAcc, &vbrUpdateBits);
- if (ret <= 0 || decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
- eof = true;
+ if (ret <= 0 || decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
break;
- }
samplePos += ret;
@@ -207,10 +204,8 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
chunkpos = 0;
dest = (int32_t *)chunk;
- if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
- eof = true;
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
break;
- }
}
}
}