summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-20 15:39:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-20 16:24:17 +0100
commitd3ed8a4d2b10e3237483da3dc72428b09992914d (patch)
tree94be001c60aa94293f6f901482ca147ee29340c8 /ffmpeg.c
parent9d60527a1315772f1d532d662a3aa607e62bb917 (diff)
ffmpeg: try to avoid calling av_log() from sigterm_handler()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index e345e410d8..e66cf2e024 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -303,15 +303,20 @@ static void sub2video_flush(InputStream *ist)
/* end of sub2video hack */
-void term_exit(void)
+static void term_exit_sigsafe(void)
{
- av_log(NULL, AV_LOG_QUIET, "%s", "");
#if HAVE_TERMIOS_H
if(restore_tty)
tcsetattr (0, TCSANOW, &oldtty);
#endif
}
+void term_exit(void)
+{
+ av_log(NULL, AV_LOG_QUIET, "%s", "");
+ term_exit_sigsafe();
+}
+
static volatile int received_sigterm = 0;
static volatile int received_nb_signals = 0;
static int main_return_code = 0;
@@ -321,7 +326,7 @@ sigterm_handler(int sig)
{
received_sigterm = sig;
received_nb_signals++;
- term_exit();
+ term_exit_sigsafe();
if(received_nb_signals > 3)
exit_program(123);
}