On 6/24/15, wm4 <nfx...@googlemail.com> wrote: > On Wed, 24 Jun 2015 13:04:27 +0200 > Michael Niedermayer <michae...@gmx.at> wrote: > >> On Wed, Jun 24, 2015 at 04:28:22AM -0600, Roger Pack wrote: >> > If it looks worth anything, see attached (there's only one file). >> > Thanks! >> >> > ffmpeg.c | 4 +++- >> > 1 file changed, 3 insertions(+), 1 deletion(-) >> > 76e781dafd7324903c7cc08dbf297bd95841126c >> > 0002-log-error-message-when-shutting-down-from-too-many-s.patch >> > From dad4f89ec0dc5bdeaeb1923e159fa12655bdde7a Mon Sep 17 00:00:00 2001 >> > From: rogerdpack <rogerpack2...@gmail.com> >> > Date: Wed, 24 Jun 2015 04:26:26 -0600 >> > Subject: [PATCH 2/2] log error message when shutting down from too many >> > signals >> > >> > Signed-off-by: rogerdpack <rogerpack2...@gmail.com> >> > --- >> > ffmpeg.c | 4 +++- >> > 1 file changed, 3 insertions(+), 1 deletion(-) >> > >> > diff --git a/ffmpeg.c b/ffmpeg.c >> > index 720e105..6aa5d1b 100644 >> > --- a/ffmpeg.c >> > +++ b/ffmpeg.c >> > @@ -324,8 +324,10 @@ sigterm_handler(int sig) >> > received_sigterm = sig; >> > received_nb_signals++; >> > term_exit_sigsafe(); >> > - if(received_nb_signals > 3) >> > + if(received_nb_signals > 3){ >> >> > + av_log(NULL, AV_LOG_ERROR, "Received %d shutdown signals, hard >> > exiting.", received_nb_signals); >> >> i think its better to use fprintf(stderr,... >> here instead of av_log() >> >> when things are already stuck for some reason staying with the >> simpler, lower level code seems more robust to me >> >> [...] >> > > Neither av_log not printf() are safe in a signal handler. > > You could use write().
I'm not as familiar with write, unfortunately. Here's a printf version FWIW, feel free to rewrite it as desired.
0002-log-error-message-when-shutting-down-from-too-many.patch
Description: Binary data
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel