mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
fftools/cmdutils: return AVERROR_EXIT for OPT_EXIT options instead of aborting()
This commit is contained in:
parent
8173623e39
commit
eda1fac27a
@ -320,7 +320,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||
}
|
||||
}
|
||||
if (po->flags & OPT_EXIT)
|
||||
exit_program(0);
|
||||
return AVERROR_EXIT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1371,6 +1371,9 @@ int main(int argc, char **argv)
|
||||
err_rate_exceeded ? 69 : ret;
|
||||
|
||||
finish:
|
||||
if (ret == AVERROR_EXIT)
|
||||
ret = 0;
|
||||
|
||||
exit_program(ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1345,7 +1345,7 @@ int ffmpeg_parse_options(int argc, char **argv)
|
||||
|
||||
fail:
|
||||
uninit_parse_context(&octx);
|
||||
if (ret < 0) {
|
||||
if (ret < 0 && ret != AVERROR_EXIT) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error %s: %s\n",
|
||||
errmsg ? errmsg : "", av_err2str(ret));
|
||||
}
|
||||
|
@ -3657,7 +3657,7 @@ int main(int argc, char **argv)
|
||||
|
||||
ret = parse_options(NULL, argc, argv, options, opt_input_file);
|
||||
if (ret < 0)
|
||||
exit(1);
|
||||
exit(ret == AVERROR_EXIT ? 0 : 1);
|
||||
|
||||
if (!input_filename) {
|
||||
show_usage();
|
||||
|
@ -4129,7 +4129,7 @@ int main(int argc, char **argv)
|
||||
show_banner(argc, argv, options);
|
||||
ret = parse_options(NULL, argc, argv, options, opt_input_file);
|
||||
if (ret < 0)
|
||||
exit_program(1);
|
||||
exit_program(ret == AVERROR_EXIT ? 0 : 1);
|
||||
|
||||
if (do_show_log)
|
||||
av_log_set_callback(log_callback);
|
||||
|
Loading…
Reference in New Issue
Block a user