diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:06 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:06 +0200 |
commit | 4c06624988785007d85c2209dfc03868da5ab1e2 (patch) | |
tree | 3366fee1cb02ae53e19ecf7739c3f4cbc256d562 /src/inputPlugins/aac_plugin.c | |
parent | ee3bbb50287210768dabf3c14a11f397871c4822 (diff) | |
download | mpd-4c06624988785007d85c2209dfc03868da5ab1e2.tar.gz mpd-4c06624988785007d85c2209dfc03868da5ab1e2.tar.xz mpd-4c06624988785007d85c2209dfc03868da5ab1e2.zip |
removed local variable "eof" because it is unused
"break" is so much easier than "eof=1; continue;", when "!eof" is the
loop condition.
Diffstat (limited to 'src/inputPlugins/aac_plugin.c')
-rw-r--r-- | src/inputPlugins/aac_plugin.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index f2d15101d..c8445250e 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -289,7 +289,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path) AudioFormat audio_format; uint32_t sampleRate; unsigned char channels; - int eof = 0; unsigned int sampleCount; char *sampleBuffer; size_t sampleBufferLen; @@ -342,13 +341,12 @@ static int aac_decode(struct decoder * mpd_decoder, char *path) advanceAacBuffer(&b, bread); - while (!eof) { + while (1) { fillAacBuffer(&b); - if (b.bytesIntoBuffer == 0) { - eof = 1; + if (b.bytesIntoBuffer == 0) break; - } + #ifdef HAVE_FAAD_BUFLEN_FUNCS sampleBuffer = faacDecDecode(decoder, &frameInfo, b.buffer, b.bytesIntoBuffer); @@ -360,7 +358,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path) ERROR("error decoding AAC file: %s\n", path); ERROR("faad2 error: %s\n", faacDecGetErrorMessage(frameInfo.error)); - eof = 1; break; } #ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE @@ -395,10 +392,8 @@ static int aac_decode(struct decoder * mpd_decoder, char *path) if (dc.command == DECODE_COMMAND_SEEK) { dc.seekError = 1; dc_command_finished(); - } else if (dc.command == DECODE_COMMAND_STOP) { - eof = 1; + } else if (dc.command == DECODE_COMMAND_STOP) break; - } } decoder_flush(mpd_decoder); |