ffmpeg: try to avoid calling av_log() from sigterm_handler()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9d60527a13
commit
d3ed8a4d2b
11
ffmpeg.c
11
ffmpeg.c
@ -303,15 +303,20 @@ static void sub2video_flush(InputStream *ist)
|
|||||||
|
|
||||||
/* end of sub2video hack */
|
/* 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 HAVE_TERMIOS_H
|
||||||
if(restore_tty)
|
if(restore_tty)
|
||||||
tcsetattr (0, TCSANOW, &oldtty);
|
tcsetattr (0, TCSANOW, &oldtty);
|
||||||
#endif
|
#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_sigterm = 0;
|
||||||
static volatile int received_nb_signals = 0;
|
static volatile int received_nb_signals = 0;
|
||||||
static int main_return_code = 0;
|
static int main_return_code = 0;
|
||||||
@ -321,7 +326,7 @@ sigterm_handler(int sig)
|
|||||||
{
|
{
|
||||||
received_sigterm = sig;
|
received_sigterm = sig;
|
||||||
received_nb_signals++;
|
received_nb_signals++;
|
||||||
term_exit();
|
term_exit_sigsafe();
|
||||||
if(received_nb_signals > 3)
|
if(received_nb_signals > 3)
|
||||||
exit_program(123);
|
exit_program(123);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user