When a recoverable error occured we always returned FRAME_HEADER_SIZE
in mp3dec, which is clearly wrong if the error did not happen in the
first frame.
Fix is not to distinguish between recoverable and unrecoverable
errors which even simplifies the code a bit.
};
/* 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);