mpc: eliminated the local variable "eof"
Since each "eof=true" is followed by "break", the variable is superfluous.
This commit is contained in:
parent
97080b796c
commit
06c60888dc
@ -108,7 +108,6 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
|
|||||||
|
|
||||||
MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
|
MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
|
||||||
|
|
||||||
bool eof = false;
|
|
||||||
long ret;
|
long ret;
|
||||||
#define MPC_CHUNK_SIZE 4096
|
#define MPC_CHUNK_SIZE 4096
|
||||||
char chunk[MPC_CHUNK_SIZE];
|
char chunk[MPC_CHUNK_SIZE];
|
||||||
@ -162,7 +161,7 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
|
|||||||
inStream->seekable,
|
inStream->seekable,
|
||||||
mpc_streaminfo_get_length(&info));
|
mpc_streaminfo_get_length(&info));
|
||||||
|
|
||||||
while (!eof) {
|
while (true) {
|
||||||
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
|
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
|
||||||
samplePos = decoder_seek_where(mpd_decoder) *
|
samplePos = decoder_seek_where(mpd_decoder) *
|
||||||
audio_format.sample_rate;
|
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,
|
ret = mpc_decoder_decode(&decoder, sample_buffer,
|
||||||
&vbrUpdateAcc, &vbrUpdateBits);
|
&vbrUpdateAcc, &vbrUpdateBits);
|
||||||
|
|
||||||
if (ret <= 0 || decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
|
if (ret <= 0 || decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
|
||||||
eof = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
samplePos += ret;
|
samplePos += ret;
|
||||||
|
|
||||||
@ -207,10 +204,8 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
|
|||||||
|
|
||||||
chunkpos = 0;
|
chunkpos = 0;
|
||||||
dest = (int32_t *)chunk;
|
dest = (int32_t *)chunk;
|
||||||
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) {
|
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
|
||||||
eof = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user