[flac-dev] Disk fragmentation

Miroslav Lichvar mlichvar at redhat.com
Wed Sep 24 00:37:30 PDT 2014


On Tue, Sep 23, 2014 at 06:42:16PM +0300, Janne Hyvärinen wrote:
> I don't know how big issue this is in *nix environments but added 
> buffering would definitely be a nice change for the Windows frontend.
> 
> 
> diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
> index 6f46d78..bd95634 100644
> --- a/src/libFLAC/stream_encoder.c
> +++ b/src/libFLAC/stream_encoder.c
> @@ -1288,6 +1288,8 @@ static FLAC__StreamEncoderInitStatus 
> init_FILE_internal_(
>       if(file == stdout)
>           file = get_binary_stdout_(); /* just to be safe */
> 
> +    setvbuf(file, NULL, _IOFBF, 10*1024*1024); /* 10MB output buffer to 
> help reduce disk fragmentation */
> +

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?

-- 
Miroslav Lichvar


More information about the flac-dev mailing list