ffmpeg: modify tty state when stderr is redirected
Removes unnecessary isatty(), fixes Ticket2964 Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
323d37521d
commit
3ae98497c2
8
ffmpeg.c
8
ffmpeg.c
@ -32,14 +32,12 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if HAVE_ISATTY
|
|
||||||
#if HAVE_IO_H
|
#if HAVE_IO_H
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "libavformat/avformat.h"
|
#include "libavformat/avformat.h"
|
||||||
#include "libavdevice/avdevice.h"
|
#include "libavdevice/avdevice.h"
|
||||||
@ -370,11 +368,7 @@ void term_init(void)
|
|||||||
#if HAVE_TERMIOS_H
|
#if HAVE_TERMIOS_H
|
||||||
if(!run_as_daemon){
|
if(!run_as_daemon){
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
int istty = 1;
|
if (tcgetattr (0, &tty) == 0) {
|
||||||
#if HAVE_ISATTY
|
|
||||||
istty = isatty(0) && isatty(2);
|
|
||||||
#endif
|
|
||||||
if (istty && tcgetattr (0, &tty) == 0) {
|
|
||||||
oldtty = tty;
|
oldtty = tty;
|
||||||
restore_tty = 1;
|
restore_tty = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user