mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
Check for termios before conio
Originally committed as revision 9598 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
14
ffmpeg.c
14
ffmpeg.c
@@ -34,15 +34,15 @@
|
|||||||
#include "fifo.h"
|
#include "fifo.h"
|
||||||
#include "avstring.h"
|
#include "avstring.h"
|
||||||
|
|
||||||
#if defined(HAVE_CONIO_H)
|
#if defined(HAVE_TERMIOS_H)
|
||||||
#include <conio.h>
|
|
||||||
#elif defined(HAVE_TERMIOS_H)
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
#elif defined(HAVE_CONIO_H)
|
||||||
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
#undef time //needed because HAVE_AV_CONFIG_H is defined on top
|
#undef time //needed because HAVE_AV_CONFIG_H is defined on top
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -334,10 +334,7 @@ static void term_init(void)
|
|||||||
/* read a key without blocking */
|
/* read a key without blocking */
|
||||||
static int read_key(void)
|
static int read_key(void)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_CONIO_H)
|
#if defined(HAVE_TERMIOS_H)
|
||||||
if(kbhit())
|
|
||||||
return(getch());
|
|
||||||
#elif defined(HAVE_TERMIOS_H)
|
|
||||||
int n = 1;
|
int n = 1;
|
||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
#ifndef CONFIG_BEOS_NETSERVER
|
#ifndef CONFIG_BEOS_NETSERVER
|
||||||
@@ -357,6 +354,9 @@ static int read_key(void)
|
|||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
#elif defined(HAVE_CONIO_H)
|
||||||
|
if(kbhit())
|
||||||
|
return(getch());
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user