Commit 73f2cf4e authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Marton Balint

ffplay: Exit on ctrl-c.

This allows to get out of ffplay if it or SDL got stuck.
This for example happens when the audio driver is playing something
else and doesnt support mixing multiple sources.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent f247f4cf
......@@ -27,6 +27,7 @@
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include <signal.h>
#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
#include "libavutil/mathematics.h"
......@@ -925,6 +926,11 @@ static void do_exit(VideoState *is)
exit(0);
}
static void sigterm_handler(int sig)
{
exit(123);
}
static int video_open(VideoState *is, int force_set_video_mode)
{
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
......@@ -3182,6 +3188,9 @@ int main(int argc, char **argv)
init_opts();
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
show_banner(argc, argv, options);
parse_options(NULL, argc, argv, options, opt_input_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment