[FFmpeg-devel] [PATCH][RFC] ffmpeg: remove access to private FILE struct members on Windows

Hendrik Leppkes h.leppkes at gmail.com
Mon Aug 3 17:08:49 CEST 2015

The FILE struct is opaque in MSVC 2015, and the members of this struct
were never meant to be accessed in any case.

No conditions are known where this check was needed to get characters
from stdin.

If someone does know which particular purpose this check serves, please
do let me know, and I'll be more than willing to find a solution which
does not involve accessing private/undocumented APIs.

diff --git a/ffmpeg.c b/ffmpeg.c
index 5575e2f..d81699e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -434,10 +434,6 @@ static int read_key(void)
         is_pipe = !GetConsoleMode(input_handle, &dw);
-    if (stdin->_cnt > 0) {
-        read(0, &ch, 1);
-        return ch;
-    }
     if (is_pipe) {
         /* When running under a GUI, you will end here. */
         if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) {

More information about the ffmpeg-devel mailing list