MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / parse_number_or_die

Function parse_number_or_die

ffmpeg-single-cmd/src/main/cpp/cmdutils.c:144–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144double parse_number_or_die(const char *context, const char *numstr, int type,
145 double min, double max)
146{
147 char *tail;
148 const char *error;
149 double d = av_strtod(numstr, &tail);
150 if (*tail)
151 error = "Expected number for %s but found: %s\n";
152 else if (d < min || d > max)
153 error = "The value for %s was %s which is not within %f - %f\n";
154 else if (type == OPT_INT64 && (int64_t)d != d)
155 error = "Expected int64 for %s but found %s\n";
156 else if (type == OPT_INT && (int)d != d)
157 error = "Expected int for %s but found %s\n";
158 else
159 return d;
160 av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max);
161 exit_program(1);
162 return 0;
163}
164
165int64_t parse_time_or_die(const char *context, const char *timestr,
166 int is_duration)

Callers 4

opt_streamidFunction · 0.85
opt_vsyncFunction · 0.85
write_optionFunction · 0.85
opt_timelimitFunction · 0.85

Calls 1

exit_programFunction · 0.85

Tested by

no test coverage detected