]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: don't reconfigure terminal if we're not taking input from stdin
authorRodger Combs <rodger.combs@gmail.com>
Thu, 8 Sep 2016 00:16:27 +0000 (19:16 -0500)
committerRodger Combs <rodger.combs@gmail.com>
Thu, 6 Oct 2016 23:31:06 +0000 (18:31 -0500)
ffmpeg.c
ffmpeg_opt.c

index ee5a768c7cca1401739d03865fc2ba4c9a9a9493..44371f0bc28859c833a4444a41a05bf99b8ed848 100644 (file)
--- 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;
@@ -4493,8 +4493,6 @@ int main(int argc, char **argv)
 
     show_banner(argc, argv, options);
 
-    term_init();
-
     /* parse options and open all input/output files */
     ret = ffmpeg_parse_options(argc, argv);
     if (ret < 0)
index d202f4396cd4482f22063470913742f7e88f70b6..bea2829e4af4e98e90692a95b9bb52c43f127110 100644 (file)
@@ -3160,6 +3160,9 @@ int ffmpeg_parse_options(int argc, char **argv)
         goto fail;
     }
 
+    /* configure terminal and setup signal handlers */
+    term_init();
+
     /* open input files */
     ret = open_files(&octx.groups[GROUP_INFILE], "input", open_input_file);
     if (ret < 0) {