MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_parse_video_rate

Function av_parse_video_rate

libavutil/parseutils.c:181–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181int av_parse_video_rate(AVRational *rate, const char *arg)
182{
183 int i, ret;
184 int n = FF_ARRAY_ELEMS(video_rate_abbrs);
185
186 /* First, we check our abbreviation table */
187 for (i = 0; i < n; ++i)
188 if (!strcmp(video_rate_abbrs[i].abbr, arg)) {
189 *rate = video_rate_abbrs[i].rate;
190 return 0;
191 }
192
193 /* Then, we try to parse it as fraction */
194 if ((ret = av_parse_ratio_quiet(rate, arg, 1001000)) < 0)
195 return ret;
196 if (!rate->num || !rate->den)
197 if ((ret = av_parse_ratio_quiet(rate, arg, INT_MAX)) < 0)
198 return ret;
199 if (rate->num <= 0 || rate->den <= 0)
200 return AVERROR(EINVAL);
201 return 0;
202}
203
204typedef struct ColorEntry {
205 const char *name; ///< a string representing the name of the color

Callers 15

create_streamFunction · 0.85
vfw_read_headerFunction · 0.85
v4l2_set_parametersFunction · 0.85
dshow_read_headerFunction · 0.85
dc1394_read_commonFunction · 0.85
mcc_initFunction · 0.85
rfc4175_parse_fmtpFunction · 0.85
set_string_video_rateFunction · 0.85
av_opt_is_set_to_defaultFunction · 0.85
test_av_parse_video_rateFunction · 0.85
new_stream_videoFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_av_parse_video_rateFunction · 0.68
config_outputFunction · 0.68