From: Andre Noll Date: Sun, 10 May 2009 13:28:13 +0000 (+0200) Subject: mp3dec: Try harder to recover from non-fatal errors. X-Git-Tag: v0.3.5~56 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=33b50d4544476d1e98a520ed2438b5a3aa5073a7;hp=f87868b3147b189b6d4ee4e44817f092bd1c2895 mp3dec: Try harder to recover from non-fatal errors. If there's still data left, try to decode the next header in the same scheduler run. This avoids unnecessary copies of large parts of the mp3 input buffer. --- diff --git a/mp3dec_filter.c b/mp3dec_filter.c index 90293f0a..92da4a5c 100644 --- a/mp3dec_filter.c +++ b/mp3dec_filter.c @@ -84,8 +84,8 @@ next_frame: out: if (pmd->stream.next_frame) { /* we still have some data */ size_t off = pmd->stream.bufend - pmd->stream.next_frame; -// PARA_INFO_LOG("off: %zd, rate: %u, returning %zd\n", off, -// fn->fc->samplerate, copy - off); + if (fn->loaded + 16384 <= fn->bufsize && off > 2048) + goto next_frame; return copy - off; } return copy;