mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
stream_encoder.c : Give the encoder a larger stdio buffer.
Windows in particular can experience slow encoding speeds on highly fragmented disks. Using setvbuf to increase the size of the buffer to 10Meg. This is probably not needed on Linux/Unix, but is very unlikely to to cause any negative effects. Patch-from: Janne Hyvärinen <cse@sci.fi>
This commit is contained in:
@@ -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 */
|
||||
|
||||
encoder->private_->file = file;
|
||||
|
||||
encoder->private_->progress_callback = progress_callback;
|
||||
|
||||
Reference in New Issue
Block a user