Factor linked list insertion in its own function
Commited in SoC by Vitor Sessak on 2008-05-24 13:33:17 Originally committed as revision 13351 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
c658f47eff
commit
e97908ee70
@ -197,6 +197,11 @@ static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void insert_inout(AVFilterInOut **inouts, AVFilterInOut *element)
|
||||||
|
{
|
||||||
|
element->next = *inouts;
|
||||||
|
*inouts = element;
|
||||||
|
}
|
||||||
|
|
||||||
static int link_filter_inouts(AVFilterContext *filter,
|
static int link_filter_inouts(AVFilterContext *filter,
|
||||||
AVFilterInOut **currInputs,
|
AVFilterInOut **currInputs,
|
||||||
@ -222,8 +227,7 @@ static int link_filter_inouts(AVFilterContext *filter,
|
|||||||
} else {
|
} else {
|
||||||
p->filter = filter;
|
p->filter = filter;
|
||||||
p->pad_idx = pad;
|
p->pad_idx = pad;
|
||||||
p->next = *openLinks;
|
insert_inout(openInputs, p);
|
||||||
*openLinks = p;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,8 +246,7 @@ static int link_filter_inouts(AVFilterContext *filter,
|
|||||||
currlinkn->type = LinkTypeOut;
|
currlinkn->type = LinkTypeOut;
|
||||||
currlinkn->filter = filter;
|
currlinkn->filter = filter;
|
||||||
currlinkn->pad_idx = pad;
|
currlinkn->pad_idx = pad;
|
||||||
currlinkn->next = *currInputs;
|
insert_inout(currInputs, currlinkn);
|
||||||
*currInputs = currlinkn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -284,8 +287,9 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
|
|||||||
link_to_add->filter = NULL;
|
link_to_add->filter = NULL;
|
||||||
link_to_add->pad_idx = pad;
|
link_to_add->pad_idx = pad;
|
||||||
}
|
}
|
||||||
link_to_add->next = *currInputs;
|
|
||||||
*currInputs = link_to_add;
|
insert_inout(currInputs, link_to_add);
|
||||||
|
|
||||||
*buf += consume_whitespace(*buf);
|
*buf += consume_whitespace(*buf);
|
||||||
pad++;
|
pad++;
|
||||||
}
|
}
|
||||||
@ -329,7 +333,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
|
|||||||
input->next = *openLinks;
|
input->next = *openLinks;
|
||||||
input->type = LinkTypeOut;
|
input->type = LinkTypeOut;
|
||||||
input->name = name;
|
input->name = name;
|
||||||
*openLinks = input;
|
insert_inout(openOutputs, input);
|
||||||
}
|
}
|
||||||
*buf += consume_whitespace(*buf);
|
*buf += consume_whitespace(*buf);
|
||||||
pad++;
|
pad++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user