[FFmpeg-cvslog] Make sure kbhit() is in conio.h

Dave Yeo git at videolan.org
Wed Mar 23 03:03:42 CET 2011


ffmpeg | branch: master | Dave Yeo <dave.r.yeo at gmail.com> | Tue Mar 22 03:47:48 2011 +0000| [b58b9fa3b5243f02e5212db9171b2f02de4524ea] | committer: Mans Rullgard

Make sure kbhit() is in conio.h

Conio.h is a non-standard header and may not have kbhit()
prototyped. This fixes compile on OS/2 where the EMX version (we're
using a fork) of conio.h only has getch() and getche().

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 configure |    4 ++--
 ffmpeg.c  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index e38f20b..19b9f98 100755
--- a/configure
+++ b/configure
@@ -1037,7 +1037,6 @@ HAVE_LIST="
     bswap
     closesocket
     cmov
-    conio_h
     dcbzl
     dev_bktr_ioctl_bt848_h
     dev_bktr_ioctl_meteor_h
@@ -1067,6 +1066,7 @@ HAVE_LIST="
     inet_aton
     inline_asm
     isatty
+    kbhit
     ldbrx
     libdc1394_1
     libdc1394_2
@@ -2775,6 +2775,7 @@ check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
 check_func  setrlimit
 check_func  strerror_r
 check_func  strtok_r
+check_func_headers conio.h kbhit
 check_func_headers io.h setmode
 check_func_headers lzo/lzo1x.h lzo1x_999_compress
 check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
@@ -2782,7 +2783,6 @@ check_func_headers windows.h GetProcessTimes
 check_func_headers windows.h MapViewOfFile
 check_func_headers windows.h VirtualAlloc
 
-check_header conio.h
 check_header dlfcn.h
 check_header dxva2api.h
 check_header malloc.h
diff --git a/ffmpeg.c b/ffmpeg.c
index 645fdb6..6922e62 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -69,7 +69,7 @@
 #include <sys/select.h>
 #endif
 
-#if HAVE_CONIO_H
+#if HAVE_KBHIT
 #include <conio.h>
 #endif
 #include <time.h>
@@ -435,7 +435,7 @@ static void term_init(void)
 /* read a key without blocking */
 static int read_key(void)
 {
-#if HAVE_CONIO_H
+#if HAVE_KBHIT
     if(kbhit())
         return(getch());
 #endif
@@ -2437,7 +2437,7 @@ static int transcode(AVFormatContext **output_files,
     }
 
     if (!using_stdin && verbose >= 0) {
-#if HAVE_CONIO_H
+#if HAVE_KBHIT
         fprintf(stderr, "Press [q] to stop encoding\n");
 #else
         fprintf(stderr, "Press ctrl-c to stop encoding\n");




More information about the ffmpeg-cvslog mailing list