|
|
|
@ -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: |
|
|
|
|