[FFmpeg-devel] [PATCH] make FLAC parser return frames when it has the required amount (without buffering)
Sat Dec 11 20:58:50 CET 2010
On 12/11/2010 02:34 PM, Michael Chinen wrote:
> On Sat, Dec 11, 2010 at 4:56 PM, Justin Ruggles
> <justin.ruggles at gmail.com> wrote:
>> On 12/10/2010 04:30 PM, Michael Chinen wrote:
>>> The FLAC parser wasn't behaving well for large inputs.
>>> For the problem, see discussion in thread "FLAC parser ineffeciency"
>>> I tested this patch with 16K, 32K, and 10MB input and it seems to work.
>>> I should note that the parser buffers by copying the entire input so
>>> for the 10MB case this is using a lot of space. Not an issue for
>>> small buffer sizes, but if it is a real use case and should be
>>> improved let me know and I can submit a separate patch that only takes
>>> small chunks of the input buffer.
>> If it's not too complicated, it might be better to have the parser guess
>> how much data it needs to have enough frames to do the analysis and only
>> read that much.
> Ok, this should do it.
The first patch will tell you how many frames are already in the buffer,
so instead of adding the full estimate for FLAC_MIN_HEADERS frames, it
could estimate how much data is needed based on how many frames it
More information about the ffmpeg-devel