aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp4_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-01 16:24:41 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-01 16:24:41 -0700
commitc36029fc806cf083de3aaf1344d6bd2be8db316f (patch)
treeda88b1f073b8125d764b94b924492d2b05ea4c69 /src/inputPlugins/mp4_plugin.c
parentaa0755f53545fcf343f791f04760f6b934e022e4 (diff)
parent6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa (diff)
downloadmpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.tar.gz
mpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.tar.xz
mpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.zip
Merge branch 'mk/cleanups'
* mk/cleanups: (60 commits) pass constant pointers const pointers unsigned integers and size_t oggflac: fix GCC warnings include cleanup protect locate.h from double inclusion playlist: eliminate unused fd parameters jack: made "sample_size" static const moved jack configuration to the JackData struct jack: removed unused macros jack: don't set audioOutput->data=NULL jack: initialize JackData in jack_initDriver() jack: added freeJackClient() jack: initialize jd->client after !jd check jack: eliminate superfluous freeJackData() calls mp3: converted the MUTEFRAME_ macros to an enum mp3: converted the DECODE_ constants to an enum wavpack: don't use "isp" before initialization wavpack: moved code to wavpack_open_wvc() simplified code in the ogg decoder plugin ...
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/mp4_plugin.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index bf200c534..8e3d02354 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -21,13 +21,7 @@
#ifdef HAVE_FAAD
#include "../utils.h"
-#include "../audio.h"
#include "../log.h"
-#include "../pcm_utils.h"
-#include "../inputStream.h"
-#include "../outputBuffer.h"
-#include "../decode.h"
-#include "../os_compat.h"
#include "../mp4ff/mp4ff.h"
@@ -100,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;
@@ -183,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);
@@ -229,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);
@@ -245,7 +237,6 @@ static int mp4_decode(InputStream * inStream)
if (frameInfo.error > 0) {
ERROR("faad2 error: %s\n",
faacDecGetErrorMessage(frameInfo.error));
- eof = 1;
break;
}
@@ -276,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);