summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libFLAC/stream_encoder.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index bd956340..029bfc64 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -1288,8 +1288,13 @@ 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 */
-
+#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_->progress_callback = progress_callback;