History

doc/examples/decode_filter_video: stop using avfilter_graph_create_filter() incorrectly

See previous commits for details.

Anton Khirnov committed 2 years ago

Commit 87faa8a1 parent 27564f91 file · +9 −3Browse files

Unified · Split

doc/examples/decode_filter_video.c+9−3
@@ -122,10 +122,10 @@ static int init_filters(const char *filters_descr) · 121 unmodified lines
122 }122 }
123 123
124 /* buffer video sink: to terminate the filter chain. */124 /* buffer video sink: to terminate the filter chain. */
125 ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",125 buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
126 NULL, NULL, filter_graph);126 if (!buffersink_ctx) {
127 if (ret < 0) {
128 av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");127 av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
128 ret = AVERROR(ENOMEM);
129 goto end;129 goto end;
130 }130 }
131 131
@@ -136,6 +136,12 @@ static int init_filters(const char *filters_descr) · 4 unmodified lines
136 goto end;136 goto end;
137 }137 }
138 138
139 ret = avfilter_init_dict(buffersink_ctx, NULL);
140 if (ret < 0) {
141 av_log(NULL, AV_LOG_ERROR, "Cannot initialize buffer sink\n");
142 goto end;
143 }
144
139 /*145 /*
140 * Set the endpoints for the filter graph. The filter_graph will146 * Set the endpoints for the filter graph. The filter_graph will
141 * be linked to the graph described by filters_descr.147 * be linked to the graph described by filters_descr.

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