Browse Source

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
tags/v0.5
Vitor Sessak 17 years ago
parent
commit
fec2e51385
1 changed files with 5 additions and 16 deletions
  1. +5
    -16
      libavfilter/graphparser.c

+ 5
- 16
libavfilter/graphparser.c View File

@@ -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;
}


Loading…
Cancel
Save