summaryrefslogtreecommitdiff
path: root/libavfilter/graphparser.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-24 20:40:44 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-24 20:40:44 +0000
commitfec2e513854cbbbc6a3d8cbadcb0fa20dbdd914e (patch)
treef58c113395219cff2bb102dd10825e7d2dc536a8 /libavfilter/graphparser.c
parentc9987633b15746581e53058aac2a1acb043679eb (diff)
Simplify extract_inout() as suggested by Michael
Commited in SoC by Vitor Sessak on 2008-04-23 18:01:31 Originally committed as revision 13324 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r--libavfilter/graphparser.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index 6a1904f3ec..5ad8522daa 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -179,26 +179,15 @@ static void free_inout(AVFilterInOut *head)
static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links)
{
AVFilterInOut *ret;
- AVFilterInOut *p;
-
- if(!links || !*links)
- return NULL;
- if(!strcmp((*links)->name, label)) {
- ret = *links;
- *links = (*links)->next;
- return ret;
- }
-
- /* First check if the label is not in the openLinks list */
- for(p = *links; p->next && strcmp(p->next->name, label); p = p->next);
- if(!p->next)
- return NULL;
+ while(*links && strcmp((*links)->name, label))
+ links= &((*links)->next);
- ret = p->next;
+ ret= *links;
- p->next = p->next->next;
+ if(ret)
+ *links= ret->next;
return ret;
}