aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/aac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:06 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-30 18:29:15 -0700
commit360c188c9d0460aff44f9c78bec25fcbab1cbead (patch)
treedccbbd8f8e0488f15f21852440370925295a7044 /src/inputPlugins/aac_plugin.c
parent27ce02fa9146601ab4a0210cc85c2d5f50b833f4 (diff)
downloadmpd-360c188c9d0460aff44f9c78bec25fcbab1cbead.tar.gz
mpd-360c188c9d0460aff44f9c78bec25fcbab1cbead.tar.xz
mpd-360c188c9d0460aff44f9c78bec25fcbab1cbead.zip
aac/mp4: 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 '')
-rw-r--r--src/inputPlugins/aac_plugin.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c
index dd255903a..7cff31d40 100644
--- a/src/inputPlugins/aac_plugin.c
+++ b/src/inputPlugins/aac_plugin.c
@@ -288,7 +288,6 @@ static int aac_decode(char *path)
long bread;
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(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(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,9 +392,10 @@ static int aac_decode(char *path)
*/
dc_action_seek_fail(DC_SEEK_ERROR);
break;
- default: eof = 1;
+ default: goto out;
}
}
+out:
faacDecClose(decoder);
if (b.buffer)