Originally committed as revision 12738 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/avfiltergraph.c (1 of 2 files). Show all
Unified · Split
| @@ -554,16 +554,25 @@ static AVFilterGraphDesc *parse_chain(const char *filters, int has_in) · 553 unmodified lines | ||
| 554 | 554 | /** |
| 555 | 555 | * Parse a string describing a filter graph. |
| 556 | 556 | */ |
| 557 | −AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters) | |
| 557 | +int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad) | |
| 558 | 558 | { |
| 559 | − AVFilterGraphDesc *ret; | |
| 559 | + AVFilterGraphDesc *desc; | |
| 560 | 560 | |
| 561 | 561 | /* Try first to parse supposing there is no (in) element */ |
| 562 | − if ((ret = parse_chain(filters, 0))) | |
| 563 | − return ret; | |
| 562 | + if (!(desc = parse_chain(filters, 0))) { | |
| 563 | + /* If it didn't work, parse supposing there is an (in) element */ | |
| 564 | + desc = parse_chain(filters, 1); | |
| 565 | + } | |
| 566 | + if (!desc) | |
| 567 | + return -1; | |
| 568 | + | |
| 569 | + if (graph_load_from_desc3(graph, desc, in, inpad, out, outpad) < 0) { | |
| 570 | + avfilter_graph_free_desc(desc); | |
| 571 | + return -1; | |
| 572 | + } | |
| 564 | 573 | |
| 565 | − /* Parse supposing there is an (in) element */ | |
| 566 | − return parse_chain(filters, 1); | |
| 574 | + avfilter_graph_free_desc(desc); | |
| 575 | + return 0; | |
| 567 | 576 | } |
| 568 | 577 | |
| 569 | 578 | /** |