From 8b6cbc3c3319f7942d679d6f6319971c102cfbd3 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 14 Aug 2014 20:42:53 +0200 Subject: avutil/opt: remove disabled old ABI compatibility code Fixes some unused variable warnings Signed-off-by: Michael Niedermayer --- libavutil/opt.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'libavutil/opt.c') diff --git a/libavutil/opt.c b/libavutil/opt.c index fec840bf71..a46797787c 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -583,7 +583,6 @@ static int set_format(void *obj, const char *name, int fmt, int search_flags, const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); int min, max; - const AVClass *class = *(AVClass **)obj; if (!o || !target_obj) return AVERROR_OPTION_NOT_FOUND; @@ -593,16 +592,9 @@ static int set_format(void *obj, const char *name, int fmt, int search_flags, return AVERROR(EINVAL); } -#if LIBAVUTIL_VERSION_MAJOR < 54 - if (class->version && class->version < AV_VERSION_INT(52, 11, 100)) { - min = -1; - max = nb_fmts-1; - } else -#endif - { - min = FFMAX(o->min, -1); - max = FFMIN(o->max, nb_fmts-1); - } + min = FFMAX(o->min, -1); + max = FFMIN(o->max, nb_fmts-1); + if (fmt < min || fmt > max) { av_log(obj, AV_LOG_ERROR, "Value %d for parameter '%s' out of %s format range [%d - %d]\n", @@ -1190,7 +1182,6 @@ void av_opt_set_defaults(void *s) void av_opt_set_defaults2(void *s, int mask, int flags) { #endif - const AVClass *class = *(AVClass **)s; const AVOption *opt = NULL; while ((opt = av_opt_next(s, opt)) != NULL) { void *dst = ((uint8_t*)s) + opt->offset; @@ -1239,20 +1230,10 @@ void av_opt_set_defaults2(void *s, int mask, int flags) set_string_video_rate(s, opt, opt->default_val.str, dst); break; case AV_OPT_TYPE_PIXEL_FMT: -#if LIBAVUTIL_VERSION_MAJOR < 54 - if (class->version && class->version < AV_VERSION_INT(52, 10, 100)) - av_opt_set(s, opt->name, opt->default_val.str, 0); - else -#endif - write_number(s, opt, dst, 1, 1, opt->default_val.i64); + write_number(s, opt, dst, 1, 1, opt->default_val.i64); break; case AV_OPT_TYPE_SAMPLE_FMT: -#if LIBAVUTIL_VERSION_MAJOR < 54 - if (class->version && class->version < AV_VERSION_INT(52, 10, 100)) - av_opt_set(s, opt->name, opt->default_val.str, 0); - else -#endif - write_number(s, opt, dst, 1, 1, opt->default_val.i64); + write_number(s, opt, dst, 1, 1, opt->default_val.i64); break; case AV_OPT_TYPE_BINARY: case AV_OPT_TYPE_DICT: -- cgit v1.2.3