From 7234e04e358bc2afc7569954c8a690c3a713f002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 19 Nov 2015 22:54:45 +0100 Subject: [PATCH] ffmpeg: enable echoing with command and debug modes Allow seeing text when pressing 'c' or 'd'. --- ffmpeg.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index 9ed40e55c8..82d9a6cbf1 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3395,6 +3395,18 @@ static OutputStream *choose_output(void) return ost_min; } +static void set_tty_echo(int on) +{ +#if HAVE_TERMIOS_H + struct termios tty; + if (tcgetattr(0, &tty) == 0) { + if (on) tty.c_lflag |= ECHO; + else tty.c_lflag &= ~ECHO; + tcsetattr(0, TCSANOW, &tty); + } +#endif +} + static int check_keyboard_interaction(int64_t cur_time) { int i, ret, key; @@ -3427,10 +3439,13 @@ static int check_keyboard_interaction(int64_t cur_time) int k, n = 0; fprintf(stderr, "\nEnter command: |all