Itay Perl <[email protected]> added the comment:

possible patch

______________________________________________
Libav issue tracker <[email protected]>
<https://roundup.libav.org/issue1521>
______________________________________________
Index: ffmpeg.c
===================================================================
--- ffmpeg.c	(revision 26402)
+++ ffmpeg.c	(working copy)
@@ -2498,8 +2498,13 @@
     }
 
     if (!using_stdin && verbose >= 0) {
-        fprintf(stderr, "Press [q] to stop encoding\n");
-        url_set_interrupt_cb(decode_interrupt_cb);
+#ifdef HAVE_ISATTY
+        if(isatty(STDIN_FILENO))
+#endif
+        {
+            fprintf(stderr, "Press [q] to stop encoding\n");
+            url_set_interrupt_cb(decode_interrupt_cb);
+        }
     }
     term_init();
 
@@ -2516,12 +2521,17 @@
         opts_min= 1e100;
         /* if 'q' pressed, exits */
         if (!using_stdin) {
-            if (q_pressed)
-                break;
-            /* read_key() returns 0 on EOF */
-            key = read_key();
-            if (key == 'q')
-                break;
+#ifdef HAVE_ISATTY
+            if(isatty(STDIN_FILENO))
+#endif
+            {
+                if (q_pressed)
+                    break;
+                /* read_key() returns 0 on EOF */
+                key = read_key();
+                if (key == 'q')
+                    break;
+            }
         }
 
         /* select the stream that we must read now by looking at the

Reply via email to