aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2007-07-11 14:04:54 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2007-07-11 14:04:54 +0000
commite16e49ac90f6da9e019fdf23084cbb256d14bd9c (patch)
treee99aa9f1d6acff4b084c15706b9922bb987d8d77 /ffmpeg.c
parent6ffa87d3254dd8bdc31b50b378e1cf59c5dc13e5 (diff)
downloadffmpeg-e16e49ac90f6da9e019fdf23084cbb256d14bd9c.tar.gz
Proper check for interactive support (termios and conio).
Originally committed as revision 9597 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 2f2bc711ab..766c6068b0 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -34,9 +34,9 @@
#include "fifo.h"
#include "avstring.h"
-#ifdef __MINGW32__
+#if defined(HAVE_CONIO_H)
#include <conio.h>
-#else
+#elif defined(HAVE_TERMIOS_H)
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -277,7 +277,7 @@ typedef struct AVInputFile {
int nb_streams; /* nb streams we are aware of */
} AVInputFile;
-#ifndef __MINGW32__
+#ifdef HAVE_TERMIOS_H
/* init terminal so that we can grab keys */
static struct termios oldtty;
@@ -285,7 +285,7 @@ static struct termios oldtty;
static void term_exit(void)
{
-#ifndef __MINGW32__
+#ifdef HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &oldtty);
#endif
}
@@ -301,7 +301,7 @@ sigterm_handler(int sig)
static void term_init(void)
{
-#ifndef __MINGW32__
+#ifdef HAVE_TERMIOS_H
struct termios tty;
tcgetattr (0, &tty);
@@ -334,10 +334,10 @@ static void term_init(void)
/* read a key without blocking */
static int read_key(void)
{
-#ifdef __MINGW32__
+#if defined(HAVE_CONIO_H)
if(kbhit())
return(getch());
-#else
+#elif defined(HAVE_TERMIOS_H)
int n = 1;
unsigned char ch;
#ifndef CONFIG_BEOS_NETSERVER