};
/* TODO: Convert all input if possible */
-#define FRAME_HEADER_SIZE 4
static ssize_t mp3dec(char *inbuffer, size_t len, struct filter_node *fn)
{
int i, ret;
pmd->stream.error = 0;
next_frame:
ret = mad_header_decode(&pmd->frame.header, &pmd->stream);
- if (ret < 0) {
- if (!MAD_RECOVERABLE(pmd->stream.error))
- goto out;
- return FRAME_HEADER_SIZE;
- }
+ if (ret < 0)
+ goto out;
fn->fc->samplerate = pmd->frame.header.samplerate;
fn->fc->channels = MAD_NCHANNELS(&pmd->frame.header);
ret = mad_frame_decode(&pmd->frame, &pmd->stream);
out:
if (pmd->stream.next_frame) { /* we still have some data */
size_t off = pmd->stream.bufend - pmd->stream.next_frame;
- PARA_DEBUG_LOG("converted %zd, rate: %u, returning %zd\n", len - off,
- fn->fc->samplerate, copy - off);
+// PARA_INFO_LOG("off: %zd, rate: %u, returning %zd\n", off,
+// fn->fc->samplerate, copy - off);
return copy - off;
}
return copy;