aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp4_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/mp4_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 'src/inputPlugins/mp4_plugin.c')
-rw-r--r--src/inputPlugins/mp4_plugin.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index 66dbbfdba..8e3d02354 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -94,7 +94,6 @@ static int mp4_decode(InputStream * inStream)
unsigned char channels;
long sampleId;
long numSamples;
- int eof = 0;
long dur;
unsigned int sampleCount;
char *sampleBuffer;
@@ -177,7 +176,7 @@ static int mp4_decode(InputStream * inStream)
seekTable = xmalloc(sizeof(float) * numSamples);
- for (sampleId = 0; sampleId < numSamples && !eof; sampleId++) {
+ for (sampleId = 0; sampleId < numSamples; sampleId++) {
if (!seeking && dc_seek()) {
dc_action_begin();
assert(dc.action == DC_ACTION_SEEK);
@@ -223,10 +222,9 @@ static int mp4_decode(InputStream * inStream)
continue;
if (mp4ff_read_sample(mp4fh, track, sampleId, &mp4Buffer,
- &mp4BufferSize) == 0) {
- eof = 1;
- continue;
- }
+ &mp4BufferSize) == 0)
+ break;
+
#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer = faacDecDecode(decoder, &frameInfo, mp4Buffer,
mp4BufferSize);
@@ -239,7 +237,6 @@ static int mp4_decode(InputStream * inStream)
if (frameInfo.error > 0) {
ERROR("faad2 error: %s\n",
faacDecGetErrorMessage(frameInfo.error));
- eof = 1;
break;
}
@@ -270,10 +267,8 @@ static int mp4_decode(InputStream * inStream)
ob_send(sampleBuffer, sampleBufferLen, file_time,
bitRate, NULL);
- if (dc_intr()) {
- eof = 1;
+ if (dc_intr())
break;
- }
}
free(seekTable);