diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-07-14 13:47:23 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-07-20 20:47:40 +0200 |
commit | 9cb47c78d66c0d8abf5dbedd254d3761d5c5b06a (patch) | |
tree | 1cb27929156e937ac021d69574f7203f29fd168c /fftools/ffprobe.c | |
parent | 4adbe2d219c13d5342d073aace5001a64c57d9c8 (diff) | |
download | ffmpeg-9cb47c78d66c0d8abf5dbedd254d3761d5c5b06a.tar.gz |
fftools: return errors from parse_number_or_die() instead of aborting
Rename the function to just parse_number().
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r-- | fftools/ffprobe.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 91a3be660b..e6fd33492d 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -3665,8 +3665,14 @@ static int opt_show_optional_fields(void *optctx, const char *opt, const char *a else if (!av_strcasecmp(arg, "never")) show_optional_fields = SHOW_OPTIONAL_FIELDS_NEVER; else if (!av_strcasecmp(arg, "auto")) show_optional_fields = SHOW_OPTIONAL_FIELDS_AUTO; - if (show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO && av_strcasecmp(arg, "auto")) - show_optional_fields = parse_number_or_die("show_optional_fields", arg, OPT_INT, SHOW_OPTIONAL_FIELDS_AUTO, SHOW_OPTIONAL_FIELDS_ALWAYS); + if (show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO && av_strcasecmp(arg, "auto")) { + double num; + int ret = parse_number("show_optional_fields", arg, OPT_INT, + SHOW_OPTIONAL_FIELDS_AUTO, SHOW_OPTIONAL_FIELDS_ALWAYS, &num); + if (ret < 0) + return ret; + show_optional_fields = num; + } return 0; } |