summaryrefslogtreecommitdiff
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-04-04 20:09:02 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-04-04 20:09:02 +0000
commit87506daafddca7c73524a1be3440244e7c99340e (patch)
tree203cd7a7fef39e0b05565f37b0cbc996e5e2af41 /libavfilter/avfiltergraph.c
parent58f472d10f09ee063cb856ce49c0cf95bc706a5c (diff)
Remove usage of AVFilterGraphDesc outside avfiltergraph.c
Commited in SoC by Vitor Sessak on 2008-03-26 20:51:24 Originally committed as revision 12738 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index c2da4cfbf8..62da23f7ca 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -554,16 +554,25 @@ static AVFilterGraphDesc *parse_chain(const char *filters, int has_in)
/**
* Parse a string describing a filter graph.
*/
-AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters)
+int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad)
{
- AVFilterGraphDesc *ret;
+ AVFilterGraphDesc *desc;
/* Try first to parse supposing there is no (in) element */
- if ((ret = parse_chain(filters, 0)))
- return ret;
+ if (!(desc = parse_chain(filters, 0))) {
+ /* If it didn't work, parse supposing there is an (in) element */
+ desc = parse_chain(filters, 1);
+ }
+ if (!desc)
+ return -1;
+
+ if (graph_load_from_desc3(graph, desc, in, inpad, out, outpad) < 0) {
+ avfilter_graph_free_desc(desc);
+ return -1;
+ }
- /* Parse supposing there is an (in) element */
- return parse_chain(filters, 1);
+ avfilter_graph_free_desc(desc);
+ return 0;
}
/**