The child objects must be allocated and inited in the preinit() callback.
Showing the changes to libavfilter/avfilter.c (1 of 1 file). Show all
Unified · Split
| @@ -897,7 +897,7 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, · 896 unmodified lines | ||
| 897 | 897 | } |
| 898 | 898 | } else { |
| 899 | 899 | av_dict_set(options, key, value, 0); |
| 900 | − if ((ret = av_opt_set(ctx->priv, key, value, 0)) < 0) { | |
| 900 | + if ((ret = av_opt_set(ctx->priv, key, value, AV_OPT_SEARCH_CHILDREN)) < 0) { | |
| 901 | 901 | if (!av_opt_find(ctx->priv, key, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) { |
| 902 | 902 | if (ret == AVERROR_OPTION_NOT_FOUND) |
| 903 | 903 | av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key); |
| @@ -948,7 +948,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) · 44 unmodified lines | ||
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | if (ctx->filter->priv_class) { |
| 951 | − ret = av_opt_set_dict(ctx->priv, options); | |
| 951 | + ret = av_opt_set_dict2(ctx->priv, options, AV_OPT_SEARCH_CHILDREN); | |
| 952 | 952 | if (ret < 0) { |
| 953 | 953 | av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n"); |
| 954 | 954 | return ret; |