aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/graphparser.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-24 20:40:58 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-24 20:40:58 +0000
commit0de3407b8f3025a60e8107d08a00b9f4df2512f2 (patch)
treecaec0a71215aa17d446196eab5fbacf4bfe1a7da /libavfilter/graphparser.c
parent4d08be028dd8d70d5e4dc6563a3a4a78ead226e4 (diff)
downloadffmpeg-0de3407b8f3025a60e8107d08a00b9f4df2512f2.tar.gz
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 Originally committed as revision 13327 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r--libavfilter/graphparser.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index ec73838c9f..032d1282b6 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -286,17 +286,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
/* First check if the label is not in the openLinks list */
p = extract_inout(name, openLinks);
- /* Not in the list, so add it as an input */
- 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 {
+ if(p) {
/* A label of a open link. Make it one of the inputs of the next
filter */
AVFilterInOut *currlinkn = p;
@@ -307,6 +297,16 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
}
currlinkn->next = *currInputs;
*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);
pad++;
@@ -332,15 +332,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
/* First check if the label is not in the openLinks list */
match = extract_inout(name, openLinks);
- /* Not in the list, so add the first input as a openLink */
- if(!match) {
- AVFilterInOut *p = *currInputs;
- *currInputs = (*currInputs)->next;
- p->next = *openLinks;
- p->type = LinkTypeOut;
- p->name = name;
- *openLinks = p;
- } else {
+ if(match) {
/* A label of a open link. Link it. */
AVFilterInOut *p = *currInputs;
if (match->type != LinkTypeIn) {
@@ -355,6 +347,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
return -1;
av_free(match);
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);
pad++;