mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
Merge remote-tracking branch 'cus/stable'
* cus/stable: ffplay: Exit on ctrl-c. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
4805a33043
9
ffplay.c
9
ffplay.c
@ -27,6 +27,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <signal.h>
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/colorspace.h"
|
#include "libavutil/colorspace.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
@ -925,6 +926,11 @@ static void do_exit(VideoState *is)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sigterm_handler(int sig)
|
||||||
|
{
|
||||||
|
exit(123);
|
||||||
|
}
|
||||||
|
|
||||||
static int video_open(VideoState *is, int force_set_video_mode)
|
static int video_open(VideoState *is, int force_set_video_mode)
|
||||||
{
|
{
|
||||||
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
||||||
@ -3182,6 +3188,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init_opts();
|
init_opts();
|
||||||
|
|
||||||
|
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
|
||||||
|
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
|
||||||
|
|
||||||
show_banner(argc, argv, options);
|
show_banner(argc, argv, options);
|
||||||
|
|
||||||
parse_options(NULL, argc, argv, options, opt_input_file);
|
parse_options(NULL, argc, argv, options, opt_input_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user