ffmpeg: use isatty() before messing with the terminal state

This fixes terminal messup in case of crashes (like in make fate)

Reviewed-by: François Revol <revol@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-05 19:58:03 +02:00
parent ad60b3b181
commit c8a11014b6
1 changed files with 3 additions and 1 deletions

View File

@ -1217,7 +1217,9 @@ static void term_init(void)
#if HAVE_TERMIOS_H
if(!run_as_daemon){
struct termios tty;
#if HAVE_ISATTY
if(isatty(0) && isatty(2))
#endif
if (tcgetattr (0, &tty) == 0) {
oldtty = tty;
restore_tty = 1;