[Flac-users] libflac memory requirements?

Josh Coalson xflac at yahoo.com
Thu Aug 15 23:18:02 PDT 2002


--- Dave Flowerday <davidf at pier13.com> wrote:
> Hello,
> Can someone give me an idea of the memory requirements for using
> libFLAC?  
> I'm trying to incorporate FLAC support into a player application for
> the
> Rio Receiver (see http://rioreceiver.comms.net for details), but I'm
> having trouble because FLAC__stream_decoder_new() is attempting to
> allocate 2099828 bytes for an instance of the
> FLAC__StreamDecoderPrivate
> struct.  Is this accurate, or is there something wrong with my setup?
>  
> I'm hoping I just have something configured wrong, because this
> device
> only has 4 megs of memory and no swap, so allocating 2+ megs isn't
> going
> to work so well.  Thanks in advance for your help!

Something is wrong... in libFLAC.  It's a testament to the
abundance of memory that this has gone unnoticed for so long.

The problem is the size of FLAC__EntropyCodingMethod_PartitionedRice.
That structure is too large.  Most FLAC streams don't require this
much memory so in this case supporting the worst case in overkill.
In the worst case the struct is 256k where as the probable case
requires only 2k.  I will fix this for the next release.

Thanks for finding that :)

Josh


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com




More information about the Flac mailing list