History

lavfi: filtfmts: use newer avfilter APIs

Vittorio Giovara committed 13 years ago

Commit 6756d981 parent 36fb0d01 file · +9 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/filtfmts.c+9−1
@@ -29,6 +29,7 @@ int main(int argc, char **argv) · 28 unmodified lines
2929 {
3030 AVFilter *filter;
3131 AVFilterContext *filter_ctx;
32+ AVFilterGraph *graph_ctx;
3233 const char *filter_name;
3334 const char *filter_args = NULL;
3435 int i, j;
@@ -44,6 +45,11 @@ int main(int argc, char **argv) · 9 unmodified lines
4445 if (argv[2])
4546 filter_args = argv[2];
4647
48+ /* allocate graph */
49+ graph_ctx = avfilter_graph_alloc();
50+ if (!graph_ctx)
51+ return 1;
52+
4753 avfilter_register_all();
4854
4955 /* get a corresponding filter and open it */
@@ -52,7 +58,8 @@ int main(int argc, char **argv) · 2 unmodified lines
5258 return 1;
5359 }
5460
55− if (avfilter_open(&filter_ctx, filter, NULL) < 0) {
61+ /* open filter and add it to the graph */
62+ if (!(filter_ctx = avfilter_graph_alloc_filter(graph_ctx, filter, filter_name))) {
5663 fprintf(stderr, "Impossible to open filter with name '%s'\n",
5764 filter_name);
5865 return 1;
@@ -99,6 +106,7 @@ int main(int argc, char **argv) · 40 unmodified lines
99106 }
100107
101108 avfilter_free(filter_ctx);
109+ avfilter_graph_free(&graph_ctx);
102110 fflush(stdout);
103111 return 0;
104112 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t