ref: 00adf5c33e051fcb97b91d4a530efe59fe0eb14a
parent: 435ec28d156b4db5362d442e67dce50028dc6462
author: LoRd_MuldeR <[email protected]>
date: Sat Dec 16 14:45:34 EST 2017
Flush 'stderr' stream after each progress message on Win32 platform, when not connected directly to a terminal. This is required so that progress updates don't get stuck in pipes.
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -80,11 +80,16 @@
if (!quiet)
{
va_start(ap, fmt);
-
vfprintf(stream, fmt, ap);
-
va_end(ap);
}
+
+#ifdef _WIN32
+ if (!_isatty(_fileno(stream)))
+ {
+ fflush(stream); /*ensure real-time progress output on Win32*/
+ }
+#endif
}
/* FAAD file buffering routines */