[FFmpeg-soc] [soc]: r2149 - libavfilter/graphparser.c

vitor subversion at mplayerhq.hu
Wed Apr 23 20:01:31 CEST 2008


Author: vitor
Date: Wed Apr 23 20:01:31 2008
New Revision: 2149

Log:
Simplify extract_inout() as suggested by Michael

Modified:
   libavfilter/graphparser.c

Modified: libavfilter/graphparser.c
==============================================================================
--- libavfilter/graphparser.c	(original)
+++ libavfilter/graphparser.c	Wed Apr 23 20:01:31 2008
@@ -179,26 +179,15 @@ static void free_inout(AVFilterInOut *he
 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;
 }



More information about the FFmpeg-soc mailing list