[FFmpeg-devel] [PATCH 1/1] fftools/ffmpeg_opt: Exit with non-zero status when destination exists

Gyan Doshi ffmpeg at gyani.pro
Mon Jul 15 16:25:22 EEST 2024



On 2024-07-15 06:26 pm, Dabrien 'Dabe' Murphy wrote:
> ---
>  fftools/ffmpeg_opt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index 2c201c74b2..dddf7c6475 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -604,13 +604,13 @@ int assert_file_overwrite(const char *filename)
>                  signal(SIGINT, SIG_DFL);
>                  if (!read_yesno()) {
>                      av_log(NULL, AV_LOG_FATAL, "Not overwriting - 
> exiting\n");
> -                    return AVERROR_EXIT;
> +                    return AVERROR(EEXIST);
>                  }
>                  term_init();
>              }
>              else {
>                  av_log(NULL, AV_LOG_FATAL, "File '%s' already exists. 
> Exiting.\n", filename);
> -                return AVERROR_EXIT;
> +                return AVERROR(EEXIST);

The former is not an error. The user was asked and the application 
behaved as per their reply.

Regards,
Gyan



More information about the ffmpeg-devel mailing list