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
122122 }
123123
124124 /* buffer video sink: to terminate the filter chain. */
125− ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
126− NULL, NULL, filter_graph);
127− if (ret < 0) {
125+ buffersink_ctx = avfilter_graph_alloc_filter(filter_graph, buffersink, "out");
126+ if (!buffersink_ctx) {
128127 av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
128+ ret = AVERROR(ENOMEM);
129129 goto end;
130130 }
131131
@@ -136,6 +136,12 @@ static int init_filters(const char *filters_descr) · 4 unmodified lines
136136 goto end;
137137 }
138138
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+
139145 /*
140146 * Set the endpoints for the filter graph. The filter_graph will
141147 * 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