| 179 | } |
| 180 | |
| 181 | int 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 | |
| 204 | typedef struct ColorEntry { |
| 205 | const char *name; ///< a string representing the name of the color |
no outgoing calls