aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-11 23:56:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-12 00:31:44 +0200
commit86070b8e5a0e0ba087a9ce2a050c00094e29f35b (patch)
tree6e82eb3de383fa6f8756c5053d26e52fbf29f07b /libavfilter/avfilter.c
parent9da369604ecf31d9dce2dee21ed214b8c43264c6 (diff)
parentbc1a985ba030e9861d24965d42792850b43a43ea (diff)
downloadffmpeg-86070b8e5a0e0ba087a9ce2a050c00094e29f35b.tar.gz
Merge commit 'bc1a985ba030e9861d24965d42792850b43a43ea'
* commit 'bc1a985ba030e9861d24965d42792850b43a43ea': lavfi: replace avfilter_open() with avfilter_graph_alloc_filter(). Conflicts: libavfilter/avfiltergraph.c libavfilter/internal.h libavfilter/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 5a99fdddd5..406537a5a6 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -490,17 +490,16 @@ static const AVClass avfilter_class = {
.child_class_next = filter_child_class_next,
};
-int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
+AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
{
AVFilterContext *ret;
- *filter_ctx = NULL;
if (!filter)
- return AVERROR(EINVAL);
+ return NULL;
ret = av_mallocz(sizeof(AVFilterContext));
if (!ret)
- return AVERROR(ENOMEM);
+ return NULL;
ret->av_class = &avfilter_class;
ret->filter = filter;
@@ -542,8 +541,7 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in
ret->input_count = ret->nb_inputs;
#endif
- *filter_ctx = ret;
- return 0;
+ return ret;
err:
av_freep(&ret->inputs);
@@ -554,8 +552,16 @@ err:
ret->nb_outputs = 0;
av_freep(&ret->priv);
av_free(ret);
- return AVERROR(ENOMEM);
+ return NULL;
+}
+
+#if FF_API_AVFILTER_OPEN
+int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
+{
+ *filter_ctx = ff_filter_alloc(filter, inst_name);
+ return *filter_ctx ? 0 : AVERROR(ENOMEM);
}
+#endif
void avfilter_free(AVFilterContext *filter)
{