Commit 6a6207b5 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

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>
parent 142cc51c
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment