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 Originally committed as revision 13319 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5cb9c725f2
commit
cf4f7d38d0
@ -199,15 +199,21 @@ static void free_inout(AVFilterInOut *head)
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a link. This funcion looks for a matching label in the *inout
|
||||
* linked list. If none is found, it adds this link to the list.
|
||||
* Parse "[a1][link2] ... [etc]"
|
||||
*/
|
||||
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,
|
||||
AVClass *log_ctx)
|
||||
{
|
||||
while (**buf == '[') {
|
||||
char *name;
|
||||
AVFilterInOut *p = *inout;
|
||||
|
||||
parse_link_name(buf, &name, log_ctx);
|
||||
|
||||
if(!name)
|
||||
return -1;
|
||||
|
||||
for (; p && strcmp(p->name, name); p = p->next);
|
||||
|
||||
if(!p) {
|
||||
@ -220,8 +226,7 @@ static int handle_link(char *name, AVFilterInOut **inout, int pad,
|
||||
inoutn->pad_idx = pad;
|
||||
inoutn->next = *inout;
|
||||
*inout = inoutn;
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(p->type == LinkTypeIn && type == LinkTypeOut) {
|
||||
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,
|
||||
}
|
||||
|
||||
p->filter = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
pad++;
|
||||
consume_whitespace(buf);
|
||||
}
|
||||
|
||||
return pad;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user