[FFmpeg-devel] [PATCH] ffplay: Exit on ctrl-c.

Alexander Strasser eclipse7 at gmx.net
Mon Jan 9 23:44:12 CET 2012


Hi Michael,

Michael Niedermayer wrote:
> 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.

  I principally like it.

> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  ffplay.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 1c4289c..bd7374a 100644
> --- a/ffplay.c
> +++ b/ffplay.c
[...]
> +static void sigterm_handler(int sig)
> +{
> +    exit(123);
> +}

  Not sure how bad this can be for ffplay on usual systems,
but I think it is not safe to call exit() from a signal
handling context.

  Maybe using _exit or _Exit would be better if it is acceptable
to depend on it. I can't think of any alternate approaches right
now.

[...]

  Alexander


More information about the ffmpeg-devel mailing list