[FFmpeg-devel] FLAC parser inefficiency

Michael Chinen mchinen
Thu Dec 9 23:48:37 CET 2010


On Thu, Dec 9, 2010 at 5:22 AM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
> The FLAC parser buffers input unnecessarily even when there's already
> enough data to return the next packet. This leads to growing internal
> buffer size and bad performance when data is fed in large enough chunks.
> In flac_parse(), the only return statement that can return a read amount
> less than the whole buf_size given as available input is the "return
> get_best_header(fpc, poutbuf, poutbuf_size);" one, and that cannot
> happen on two consecutive calls as the statement is under "if
> (fpc->best_header_valid)" but get_best_header() sets that to false. Thus
> if you consider a hypothetical case where a program provides say
> buf_size=10M bytes of available input to each parse call then it's
> obvious that things are not going to work - the code will return at most
> one packet of output per call but will read at least 10 MB of input per
> every two calls.

Is there a way to make ffmpeg/ffplay feed the parser a large amount of
data like this for testing?


More information about the ffmpeg-devel mailing list