Commit 81dc12e1 authored by vitor's avatar vitor

Replace if(!a){B}else{C} by if(a){C}else{B}

Commited in SoC by Vitor Sessak on 2008-04-23 18:24:46


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13327 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 53343c63
...@@ -286,17 +286,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs, ...@@ -286,17 +286,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
/* First check if the label is not in the openLinks list */ /* First check if the label is not in the openLinks list */
p = extract_inout(name, openLinks); p = extract_inout(name, openLinks);
/* Not in the list, so add it as an input */ if(p) {
if(!p) {
AVFilterInOut *currlinkn = av_malloc(sizeof(AVFilterInOut));
currlinkn->name = name;
currlinkn->type = LinkTypeIn;
currlinkn->filter = NULL;
currlinkn->pad_idx = pad;
currlinkn->next = *currInputs;
*currInputs = currlinkn;
} else {
/* A label of a open link. Make it one of the inputs of the next /* A label of a open link. Make it one of the inputs of the next
filter */ filter */
AVFilterInOut *currlinkn = p; AVFilterInOut *currlinkn = p;
...@@ -307,6 +297,16 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs, ...@@ -307,6 +297,16 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
} }
currlinkn->next = *currInputs; currlinkn->next = *currInputs;
*currInputs = currlinkn; *currInputs = currlinkn;
} else {
/* Not in the list, so add it as an input */
AVFilterInOut *currlinkn = av_malloc(sizeof(AVFilterInOut));
currlinkn->name = name;
currlinkn->type = LinkTypeIn;
currlinkn->filter = NULL;
currlinkn->pad_idx = pad;
currlinkn->next = *currInputs;
*currInputs = currlinkn;
} }
consume_whitespace(buf); consume_whitespace(buf);
pad++; pad++;
...@@ -332,15 +332,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, ...@@ -332,15 +332,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
/* First check if the label is not in the openLinks list */ /* First check if the label is not in the openLinks list */
match = extract_inout(name, openLinks); match = extract_inout(name, openLinks);
/* Not in the list, so add the first input as a openLink */ if(match) {
if(!match) {
AVFilterInOut *p = *currInputs;
*currInputs = (*currInputs)->next;
p->next = *openLinks;
p->type = LinkTypeOut;
p->name = name;
*openLinks = p;
} else {
/* A label of a open link. Link it. */ /* A label of a open link. Link it. */
AVFilterInOut *p = *currInputs; AVFilterInOut *p = *currInputs;
if (match->type != LinkTypeIn) { if (match->type != LinkTypeIn) {
...@@ -355,6 +347,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, ...@@ -355,6 +347,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
return -1; return -1;
av_free(match); av_free(match);
av_free(p); av_free(p);
} else {
/* Not in the list, so add the first input as a openLink */
AVFilterInOut *p = *currInputs;
*currInputs = (*currInputs)->next;
p->next = *openLinks;
p->type = LinkTypeOut;
p->name = name;
*openLinks = p;
} }
consume_whitespace(buf); consume_whitespace(buf);
pad++; pad++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment