The two functions are exactly the same.
Unified · Split
| @@ -1277,18 +1277,7 @@ int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_ · 1276 unmodified lines | |||
| 1277 | 1277 | ||
| 1278 | int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val) | 1278 | int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val) |
| 1279 | { | 1279 | { |
| 1280 | int64_t intnum = 1; | 1280 | return av_opt_get_q(obj, name, search_flags, out_val); |
| 1281 | double num = 1; | ||
| 1282 | int ret, den = 1; | ||
| 1283 | |||
| 1284 | if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0) | ||
| 1285 | return ret; | ||
| 1286 | |||
| 1287 | if (num == 1.0 && (int)intnum == intnum) | ||
| 1288 | *out_val = (AVRational) { intnum, den }; | ||
| 1289 | else | ||
| 1290 | *out_val = av_d2q(num * intnum / den, 1 << 24); | ||
| 1291 | return 0; | ||
| 1292 | } | 1281 | } |
| 1293 | 1282 | ||
| 1294 | static int get_format(void *obj, const char *name, int search_flags, int *out_fmt, | 1283 | static int get_format(void *obj, const char *name, int search_flags, int *out_fmt, |