diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-20 12:48:15 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-20 12:50:51 +0400 |
commit | b67401797e4e51c0fdc0978d2219ac3703403a85 (patch) | |
tree | 1286e7ce2646853a19aa800069aae1be054397a4 /libavfilter/filtfmts.c | |
parent | 48353325372ae7c1721c55bafe33cf0816301a5e (diff) | |
parent | 6756d98cec7dbeab6d407abc656d06d7ba97fdda (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavfi: filtfmts: use newer avfilter APIs
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/filtfmts.c')
-rw-r--r-- | libavfilter/filtfmts.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c index 93150d3c9d..6d4da68090 100644 --- a/libavfilter/filtfmts.c +++ b/libavfilter/filtfmts.c @@ -69,6 +69,7 @@ int main(int argc, char **argv) { AVFilter *filter; AVFilterContext *filter_ctx; + AVFilterGraph *graph_ctx; const char *filter_name; const char *filter_args = NULL; int i; @@ -84,6 +85,11 @@ int main(int argc, char **argv) if (argc > 2) filter_args = argv[2]; + /* allocate graph */ + graph_ctx = avfilter_graph_alloc(); + if (!graph_ctx) + return 1; + avfilter_register_all(); /* get a corresponding filter and open it */ @@ -92,7 +98,8 @@ int main(int argc, char **argv) return 1; } - if (avfilter_open(&filter_ctx, filter, NULL) < 0) { + /* open filter and add it to the graph */ + if (!(filter_ctx = avfilter_graph_alloc_filter(graph_ctx, filter, filter_name))) { fprintf(stderr, "Impossible to open filter with name '%s'\n", filter_name); return 1; @@ -123,6 +130,7 @@ int main(int argc, char **argv) print_formats(filter_ctx); avfilter_free(filter_ctx); + avfilter_graph_free(&graph_ctx); fflush(stdout); return 0; } |