diff options
author | Martin Storsjö <martin@martin.st> | 2011-05-22 14:40:33 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-05-22 22:06:20 +0300 |
commit | a121754852a69b4879a39ba78863404c13c54f61 (patch) | |
tree | 2bd8ad6642ff5913630ea02e4e0ca823326e2e93 /ffmpeg.c | |
parent | 8089b7fa8c5b5a48cc7101daa4be891d0ead5a5e (diff) | |
download | ffmpeg-a121754852a69b4879a39ba78863404c13c54f61.tar.gz |
ffmpeg: Don't trigger url_interrupt_cb on the first signal
Currently, the url_interrupt_cb callback will abort all IO
after the first received signal. This makes the output files
from e.g. the mov muxer to be unreadable if the transcode is
aborted with ctrl+c.
After this patch, the first signal cleanly breaks out of
the transcoding loop, but won't forcibly abort all IO.
After the second signal is received, the url_interrupt_cb
callback will abort all IO.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -426,11 +426,13 @@ static void term_exit(void) } static volatile int received_sigterm = 0; +static volatile int received_nb_signals = 0; static void sigterm_handler(int sig) { received_sigterm = sig; + received_nb_signals++; term_exit(); } @@ -445,7 +447,7 @@ static void term_init(void) static int decode_interrupt_cb(void) { - return received_sigterm; + return received_nb_signals > 1; } static int ffmpeg_exit(int ret) |