Since we do not support "standalone" filters not attached to an AVFilterGraph, we should not have a public function to create such filters. In addition that function is horribly named, the action it does cannot be possibly described as "opening" a filter.
Showing the changes to libavfilter/graphparser.c (1 of 7 files). Show all
Unified · Split
| @@ -109,16 +109,11 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind · 108 unmodified lines | ||
| 109 | 109 | return AVERROR(EINVAL); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | − ret = avfilter_open(filt_ctx, filt, inst_name); | |
| 112 | + *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name); | |
| 113 | 113 | if (!*filt_ctx) { |
| 114 | 114 | av_log(log_ctx, AV_LOG_ERROR, |
| 115 | 115 | "Error creating filter '%s'\n", filt_name); |
| 116 | − return ret; | |
| 117 | − } | |
| 118 | − | |
| 119 | − if ((ret = avfilter_graph_add_filter(ctx, *filt_ctx)) < 0) { | |
| 120 | − avfilter_free(*filt_ctx); | |
| 121 | − return ret; | |
| 116 | + return AVERROR(ENOMEM); | |
| 122 | 117 | } |
| 123 | 118 | |
| 124 | 119 | if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") && |