[FFmpeg-devel] [PATCH 1/2] ffmpeg: don't reconfigure terminal if we're not taking input from stdin

Rodger Combs rodger.combs at gmail.com
Thu Sep 8 03:17:59 EEST 2016


---
 ffmpeg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index d858407..1d793fe 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -366,7 +366,7 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
 void term_init(void)
 {
 #if HAVE_TERMIOS_H
-    if(!run_as_daemon){
+    if (!run_as_daemon && stdin_interaction) {
         struct termios tty;
         if (tcgetattr (0, &tty) == 0) {
             oldtty = tty;
@@ -4328,6 +4328,10 @@ int main(int argc, char **argv)
 
     show_banner(argc, argv, options);
 
+    ret = locate_option(argc, argv, options, "stdin");
+    if (ret && !strcmp(argv[ret], "-nostdin"))
+        stdin_interaction = 0;
+
     term_init();
 
     /* parse options and open all input/output files */
-- 
2.9.3



More information about the ffmpeg-devel mailing list