| 82 | } |
| 83 | |
| 84 | int parse_number(const char *context, const char *numstr, enum OptionType type, |
| 85 | double min, double max, double *dst) |
| 86 | { |
| 87 | char *tail; |
| 88 | const char *error; |
| 89 | double d = av_strtod(numstr, &tail); |
| 90 | if (*tail) |
| 91 | error = "Expected number for %s but found: %s\n"; |
| 92 | else if (d < min || d > max) |
| 93 | error = "The value for %s was %s which is not within %f - %f\n"; |
| 94 | else if (type == OPT_TYPE_INT64 && (int64_t)d != d) |
| 95 | error = "Expected int64 for %s but found %s\n"; |
| 96 | else if (type == OPT_TYPE_INT && (int)d != d) |
| 97 | error = "Expected int for %s but found %s\n"; |
| 98 | else { |
| 99 | *dst = d; |
| 100 | return 0; |
| 101 | } |
| 102 | |
| 103 | av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max); |
| 104 | return AVERROR(EINVAL); |
| 105 | } |
| 106 | |
| 107 | void show_help_options(const OptionDef *options, const char *msg, int req_flags, |
| 108 | int rej_flags) |
no test coverage detected