[FFmpeg-cvslog] fftools: Check HAVE_GETSTDHANDLE before using GetStdHandle

Martin Storsjö git at videolan.org
Mon Oct 23 13:09:01 EEST 2023


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Oct 22 14:03:29 2023 +0300| [ff5a3575fec2d49d5fae4ec1198a939e203314db] | committer: Martin Storsjö

fftools: Check HAVE_GETSTDHANDLE before using GetStdHandle

GetStdHandle is unavailable outside of the desktop API subset.

This didn't use to be a problem with earlier WinSDKs, as kbhit also
used to be available only for desktop apps, and this whole section is
wrapped in #if HAVE_KBHIT. With newer WinSDKs, kbhit() is available also
for non-desktop apps, while GetStdHandle still isn't.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff5a3575fec2d49d5fae4ec1198a939e203314db
---

 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 7c33b56cd3..46a85b41a8 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -308,7 +308,7 @@ static int read_key(void)
         return n;
     }
 #elif HAVE_KBHIT
-#    if HAVE_PEEKNAMEDPIPE
+#    if HAVE_PEEKNAMEDPIPE && HAVE_GETSTDHANDLE
     static int is_pipe;
     static HANDLE input_handle;
     DWORD dw, nchars;



More information about the ffmpeg-cvslog mailing list