lavu/opt: forward av_opt_get_video_rate() to av_opt_get_q()

The two functions are exactly the same.
This commit is contained in:
Anton Khirnov 2024-08-17 16:29:30 +02:00
parent efe38286d1
commit 4a5bb84515
1 changed files with 1 additions and 12 deletions

View File

@ -1277,18 +1277,7 @@ int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_
int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val) int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val)
{ {
int64_t intnum = 1; return av_opt_get_q(obj, name, search_flags, out_val);
double num = 1;
int ret, den = 1;
if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0)
return ret;
if (num == 1.0 && (int)intnum == intnum)
*out_val = (AVRational) { intnum, den };
else
*out_val = av_d2q(num * intnum / den, 1 << 24);
return 0;
} }
static int get_format(void *obj, const char *name, int search_flags, int *out_fmt, static int get_format(void *obj, const char *name, int search_flags, int *out_fmt,