See previous commits for details.
Unified · Split
| @@ -122,10 +122,10 @@ static int init_filters(const char *filters_descr) · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* 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) { | |
| 128 | 127 | av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); |
| 128 | + ret = AVERROR(ENOMEM); | |
| 129 | 129 | goto end; |
| 130 | 130 | } |
| 131 | 131 | |
| @@ -136,6 +136,12 @@ static int init_filters(const char *filters_descr) · 4 unmodified lines | ||
| 136 | 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 | 146 | * Set the endpoints for the filter graph. The filter_graph will |
| 141 | 147 | * be linked to the graph described by filters_descr. |