X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3dec.c;h=615a06400a58f34408ffef12a7b0be436b51a026;hp=763ca37f2288eab98d0bcb34d6f641f7d4b38793;hb=50a7656fd9ba7bb27762aa3daac51ce453722437;hpb=c8862b9e246b4ef6ff1fe103946e18cf2537ecde diff --git a/mp3dec.c b/mp3dec.c index 763ca37f..615a0640 100644 --- a/mp3dec.c +++ b/mp3dec.c @@ -43,15 +43,25 @@ static ssize_t mp3dec(char *inbuffer, size_t len, struct filter_node *fn) pmd->stream.error = 0; next_frame: ret = mad_header_decode(&pmd->frame.header, &pmd->stream); - if (ret < 0) + if (ret < 0) { + if (pmd->stream.error != MAD_ERROR_BUFLEN && + pmd->stream.error != MAD_ERROR_LOSTSYNC) + PARA_DEBUG_LOG("header decode: %s\n", + mad_stream_errorstr(&pmd->stream)); 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); if (ret) { - if (MAD_RECOVERABLE(pmd->stream.error) || pmd->stream.error == MAD_ERROR_BUFLEN) + if (MAD_RECOVERABLE(pmd->stream.error) || + pmd->stream.error == MAD_ERROR_BUFLEN) { + PARA_DEBUG_LOG("frame decode: %s\n", + mad_stream_errorstr(&pmd->stream)); goto out; - PARA_ERROR_LOG("fatal: ret = %d, loaded = %zd\n", ret, fn->loaded); + } + PARA_ERROR_LOG("frame decode: %s\n", + mad_stream_errorstr(&pmd->stream)); return -E_MAD_FRAME_DECODE; } mad_synth_frame(&pmd->synth, &pmd->frame);