[FFmpeg-devel] [PATCHv2] ffmpeg: modify tty state when stderr is redirected

Ganesh Ajjanagadde gajjanagadde at gmail.com
Fri Jul 31 05:26:05 CEST 2015


This fixes Ticket2964

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 ffmpeg.c          | 2 +-
 tests/fate-run.sh | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 5575e2f..eb3f613 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -372,7 +372,7 @@ void term_init(void)
         struct termios tty;
         int istty = 1;
 #if HAVE_ISATTY
-        istty = isatty(0) && isatty(2);
+        istty = isatty(0);
 #endif
         if (istty && tcgetattr (0, &tty) == 0) {
             oldtty = tty;
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index b88730a..fab0af2 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -92,6 +92,7 @@ probeframes(){
 }
 
 ffmpeg(){
+    stty_opts="$(stty --save)"
     dec_opts="-hwaccel $hwaccel -threads $threads -thread_type $thread_type"
     ffmpeg_args="-nostats -cpuflags $cpuflags"
     for arg in $@; do
@@ -99,6 +100,7 @@ ffmpeg(){
         ffmpeg_args="${ffmpeg_args} ${arg}"
     done
     run ffmpeg ${ffmpeg_args}
+    stty "${stty_opts}"
 }
 
 framecrc(){
-- 
2.5.0



More information about the ffmpeg-devel mailing list