- AVFilterContext *filt, *filtb;
-
- char tmp[20];
-
- snprintf(tmp, 20, "%d", src);
- if(!(filt = avfilter_graph_get_filter(ctx, tmp))) {
- av_log(&log_ctx, AV_LOG_ERROR, "link source does not exist in graph\n");
- return -1;
- }
- snprintf(tmp, 20, "%d", dst);
- if(!(filtb = avfilter_graph_get_filter(ctx, tmp))) {
- av_log(&log_ctx, AV_LOG_ERROR, "link destination does not exist in graph\n");
- return -1;
- }
- if(avfilter_link(filt, srcpad, filtb, dstpad)) {
- av_log(&log_ctx, AV_LOG_ERROR, "cannot create link between source and destination filters\n");
+ if(avfilter_link(src, srcpad, dst, dstpad)) {
+ av_log(&log_ctx, AV_LOG_ERROR,
+ "cannot create the link %s:%d -> %s:%d\n",
+ src->filter->name, srcpad, dst->filter->name, dstpad);