1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avutil/opt: remove disabled old ABI compatibility code

Fixes some unused variable warnings

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-08-14 20:42:53 +02:00
parent fce8817a01
commit 8b6cbc3c33

View File

@@ -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, const AVOption *o = av_opt_find2(obj, name, NULL, 0,
search_flags, &target_obj); search_flags, &target_obj);
int min, max; int min, max;
const AVClass *class = *(AVClass **)obj;
if (!o || !target_obj) if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND; 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); return AVERROR(EINVAL);
} }
#if LIBAVUTIL_VERSION_MAJOR < 54 min = FFMAX(o->min, -1);
if (class->version && class->version < AV_VERSION_INT(52, 11, 100)) { max = FFMIN(o->max, nb_fmts-1);
min = -1;
max = nb_fmts-1;
} else
#endif
{
min = FFMAX(o->min, -1);
max = FFMIN(o->max, nb_fmts-1);
}
if (fmt < min || fmt > max) { if (fmt < min || fmt > max) {
av_log(obj, AV_LOG_ERROR, av_log(obj, AV_LOG_ERROR,
"Value %d for parameter '%s' out of %s format range [%d - %d]\n", "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) void av_opt_set_defaults2(void *s, int mask, int flags)
{ {
#endif #endif
const AVClass *class = *(AVClass **)s;
const AVOption *opt = NULL; const AVOption *opt = NULL;
while ((opt = av_opt_next(s, opt)) != NULL) { while ((opt = av_opt_next(s, opt)) != NULL) {
void *dst = ((uint8_t*)s) + opt->offset; 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); set_string_video_rate(s, opt, opt->default_val.str, dst);
break; break;
case AV_OPT_TYPE_PIXEL_FMT: case AV_OPT_TYPE_PIXEL_FMT:
#if LIBAVUTIL_VERSION_MAJOR < 54 write_number(s, opt, dst, 1, 1, opt->default_val.i64);
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);
break; break;
case AV_OPT_TYPE_SAMPLE_FMT: case AV_OPT_TYPE_SAMPLE_FMT:
#if LIBAVUTIL_VERSION_MAJOR < 54 write_number(s, opt, dst, 1, 1, opt->default_val.i64);
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);
break; break;
case AV_OPT_TYPE_BINARY: case AV_OPT_TYPE_BINARY:
case AV_OPT_TYPE_DICT: case AV_OPT_TYPE_DICT: