Miroslav Lichvar wrote:> Hm, does this mean that every process encoding FLAC files will now > need extra 10MB of memory? Is that ok for small devices with limited > memory?What small device do you have in mind? The smallest device I could possibly imagine *encoding* FLAC on is Rasberry Pi which has 512Meg of RAM. If you really are concerned about this (and knowing that it has little benefit on Linux) maybe we could wrap it in a Windows only #ifdef. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
> What small device do you have in mind? The smallest device I > could possibly imagine *encoding* FLAC on is Rasberry Pi which > has 512Meg of RAM.Well, from the code it's clear that quite some effort was put into making libFLAC usable on platforms that have no FPU, as there is a integer-only define that actually works. I could think of small handheld recorders like the Zoom H1 or something like that to use FLAC. On the other hand, devices with no FPU are usually embedded, and embedded developers change some code anyway. Maybe it's a good idea to just mention this in the README, under the "Note to embedded developers", as something that can be removed without problem?
Martijn van Beurden <mvanb1 at gmail.com> ?????(?) ? ????? ?????? Wed, 24 Sep 2014 16:09:38 +0400:> Well, from the code it's clear that quite some effort was put > into making libFLAC usable on platforms that have no FPU, as > there is a integer-only define that actually works. I could > think of small handheld recorders like the Zoom H1 or something > like that to use FLAC. > > On the other hand, devices with no FPU are usually embedded, and > embedded developers change some code anyway. Maybe it's a good > idea to just mention this in the README, under the "Note to > embedded developers", as something that can be removed without > problem?IMHO it's better to move setvbuf() out of libFLAC/stream_encoder.c into flac/encode.c. I can see two ways to do this: 1) Add a new function to libFLAC API that have access to encoder->private_->file and can call setvbuf: FLAC_API FLAC__bool FLAC__stream_encoder_set_buffer_size(FLAC__StreamEncoder *encoder, unsigned size); 2) Rewrite EncoderSession_init_encoder() in flac/encode.c so that it opens the file, calls setvbuf and then uses FLAC__stream_encoder_init[_ogg]_stream() instead of FLAC__stream_encoder_init[_ogg]_file(). It's more difficult, but doesn't require API change.