Commit 5479bca4 authored by vitor's avatar vitor

Move code from handle_link() to the only place the function is called

Commited in SoC by Vitor Sessak on 2008-04-18 18:18:35


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13319 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0560a6a3
...@@ -199,15 +199,21 @@ static void free_inout(AVFilterInOut *head) ...@@ -199,15 +199,21 @@ static void free_inout(AVFilterInOut *head)
} }
/** /**
* Process a link. This funcion looks for a matching label in the *inout * Parse "[a1][link2] ... [etc]"
* linked list. If none is found, it adds this link to the list.
*/ */
static int handle_link(char *name, AVFilterInOut **inout, int pad, static int parse_inouts(const char **buf, AVFilterInOut **inout, int pad,
enum LinkType type, AVFilterContext *filter, enum LinkType type, AVFilterContext *filter,
AVClass *log_ctx) AVClass *log_ctx)
{ {
while (**buf == '[') {
char *name;
AVFilterInOut *p = *inout; AVFilterInOut *p = *inout;
parse_link_name(buf, &name, log_ctx);
if(!name)
return -1;
for (; p && strcmp(p->name, name); p = p->next); for (; p && strcmp(p->name, name); p = p->next);
if(!p) { if(!p) {
...@@ -220,8 +226,7 @@ static int handle_link(char *name, AVFilterInOut **inout, int pad, ...@@ -220,8 +226,7 @@ static int handle_link(char *name, AVFilterInOut **inout, int pad,
inoutn->pad_idx = pad; inoutn->pad_idx = pad;
inoutn->next = *inout; inoutn->next = *inout;
*inout = inoutn; *inout = inoutn;
return 0; } else {
}
if(p->type == LinkTypeIn && type == LinkTypeOut) { if(p->type == LinkTypeIn && type == LinkTypeOut) {
if(link_filter(filter, pad, p->filter, p->pad_idx, log_ctx) < 0) if(link_filter(filter, pad, p->filter, p->pad_idx, log_ctx) < 0)
...@@ -237,31 +242,12 @@ static int handle_link(char *name, AVFilterInOut **inout, int pad, ...@@ -237,31 +242,12 @@ static int handle_link(char *name, AVFilterInOut **inout, int pad,
} }
p->filter = NULL; p->filter = NULL;
}
return 0; pad++;
}
/**
* Parse "[a1][link2] ... [etc]"
*/
static int parse_inouts(const char **buf, AVFilterInOut **inout, int pad,
enum LinkType type, AVFilterContext *filter,
AVClass *log_ctx)
{
while (**buf == '[') {
char *name;
parse_link_name(buf, &name, log_ctx);
if(!name)
return -1;
if(handle_link(name, inout, pad++, type, filter, log_ctx) < 0)
return -1;
consume_whitespace(buf); consume_whitespace(buf);
} }
return pad; return pad;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment