| 246 | } |
| 247 | |
| 248 | static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, |
| 249 | AVFilterInOut **open_inputs, |
| 250 | AVFilterInOut **open_outputs, AVClass *log_ctx) |
| 251 | { |
| 252 | int pad = 0; |
| 253 | |
| 254 | while(**buf == '[') { |
| 255 | char *name = parse_link_name(buf, log_ctx); |
| 256 | AVFilterInOut *match; |
| 257 | |
| 258 | AVFilterInOut *input = *curr_inputs; |
| 259 | *curr_inputs = (*curr_inputs)->next; |
| 260 | |
| 261 | if(!name) |
| 262 | return -1; |
| 263 | |
| 264 | /* First check if the label is not in the open_inputs list */ |
| 265 | match = extract_inout(name, open_inputs); |
| 266 | |
| 267 | if(match) { |
| 268 | if(link_filter(input->filter, input->pad_idx, |
| 269 | match->filter, match->pad_idx, log_ctx) < 0) |
| 270 | return -1; |
| 271 | av_free(match->name); |
| 272 | av_free(name); |
| 273 | av_free(match); |
| 274 | av_free(input); |
| 275 | } else { |
| 276 | /* Not in the list, so add the first input as a open_output */ |
| 277 | input->name = name; |
| 278 | insert_inout(open_outputs, input); |
| 279 | } |
| 280 | *buf += strspn(*buf, WHITESPACES); |
| 281 | pad++; |
| 282 | } |
| 283 | |
| 284 | return pad; |
| 285 | } |
| 286 | |
| 287 | int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, |
| 288 | AVFilterInOut *open_inputs, |
no test coverage detected