mirror of https://github.com/xiph/flac
stream_encoder.c : Only set 10MB output buffer on _WIN32.
Commig 6a6207b52a
set the size of the encoder output buffer to 10MB
but this fix is really only needed on Windows, so wrap it in an #ifdef.
This commit is contained in:
parent
25db9b2cce
commit
e863247777
|
@ -1288,8 +1288,13 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_(
|
||||||
if(file == stdout)
|
if(file == stdout)
|
||||||
file = get_binary_stdout_(); /* just to be safe */
|
file = get_binary_stdout_(); /* just to be safe */
|
||||||
|
|
||||||
setvbuf(file, NULL, _IOFBF, 10*1024*1024); /* 10MB output buffer to help reduce disk fragmentation */
|
#ifdef _WIN32
|
||||||
|
/*
|
||||||
|
* Windows can suffer quite badly from disk fragmentation. This can be
|
||||||
|
* reduced significantly by setting the output buffer size to be 10MB.
|
||||||
|
*/
|
||||||
|
setvbuf(file, NULL, _IOFBF, 10*1024*1024);
|
||||||
|
#endif
|
||||||
encoder->private_->file = file;
|
encoder->private_->file = file;
|
||||||
|
|
||||||
encoder->private_->progress_callback = progress_callback;
|
encoder->private_->progress_callback = progress_callback;
|
||||||
|
|
Loading…
Reference in New Issue