diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-02-08 16:04:04 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-03-01 16:57:24 +0100 |
commit | 1ffa657a0347b7f84dd737b8c91890ad26ac54f5 (patch) | |
tree | 62054995cf62c316fe6128b21274a2da1f1ada06 /libavutil/opt.c | |
parent | 84ba46fa5ebcccbefa5971bea3272ad30eb1d324 (diff) | |
download | ffmpeg-1ffa657a0347b7f84dd737b8c91890ad26ac54f5.tar.gz |
lavu/opt: simplify error handling in get_number()
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 74c191dafa..f9d44b8d52 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -971,16 +971,11 @@ static int get_number(void *obj, const char *name, double *num, int *den, int64_ void *dst, *target_obj; const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); if (!o || !target_obj) - goto error; + return AVERROR_OPTION_NOT_FOUND; dst = ((uint8_t *)target_obj) + o->offset; return read_number(o, dst, num, den, intnum); - -error: - *den = - *intnum = 0; - return -1; } int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val) |