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
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:06 +0200
commit4c06624988785007d85c2209dfc03868da5ab1e2 (patch)
tree3366fee1cb02ae53e19ecf7739c3f4cbc256d562 /src/inputPlugins/mp4_plugin.c
parentee3bbb50287210768dabf3c14a11f397871c4822 (diff)
downloadmpd-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/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 ac681a073..4ffe4658f 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -95,7 +95,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
unsigned char channels;
long sampleId;
long numSamples;
- int eof = 0;
long dur;
unsigned int sampleCount;
char *sampleBuffer;
@@ -178,7 +177,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
seekTable = xmalloc(sizeof(float) * numSamples);
- for (sampleId = 0; sampleId < numSamples && !eof; sampleId++) {
+ for (sampleId = 0; sampleId < numSamples; sampleId++) {
if (dc.command == DECODE_COMMAND_SEEK)
seeking = 1;
@@ -221,10 +220,9 @@ static int mp4_decode(struct decoder * mpd_decoder, 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);
@@ -237,7 +235,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
if (frameInfo.error > 0) {
ERROR("faad2 error: %s\n",
faacDecGetErrorMessage(frameInfo.error));
- eof = 1;
break;
}
@@ -273,10 +270,8 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
decoder_data(mpd_decoder, inStream, 1, sampleBuffer,
sampleBufferLen, file_time,
bitRate, NULL);
- if (dc.command == DECODE_COMMAND_STOP) {
- eof = 1;
+ if (dc.command == DECODE_COMMAND_STOP)
break;
- }
}
free(seekTable);