aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2009-04-21 19:08:49 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2009-04-21 19:08:49 +0000
commitfd548e5bd6c1a11ad6739143817c125a41efe5f5 (patch)
tree17e4d4ca132ffb20d77749743e79393326205a53 /libavfilter
parent3d10a8904d638b10036228f439755e79a15e02d4 (diff)
downloadffmpeg-fd548e5bd6c1a11ad6739143817c125a41efe5f5.tar.gz
Remove consume_whitespace() and replace it with direct calls to
strspn(). Originally committed as revision 18645 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/graphparser.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index 69a80acb89..a51331fb22 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -27,6 +27,8 @@
#include "avfilter.h"
#include "avfiltergraph.h"
+#define WHITESPACES " \n\t"
+
static int link_filter(AVFilterContext *src, int srcpad,
AVFilterContext *dst, int dstpad,
AVClass *log_ctx)
@@ -41,11 +43,6 @@ static int link_filter(AVFilterContext *src, int srcpad,
return 0;
}
-static int consume_whitespace(const char *buf)
-{
- return strspn(buf, " \n\t");
-}
-
/**
* Consumes a string from *buf.
* @return a copy of the consumed string, which should be free'd after use
@@ -55,7 +52,7 @@ static char *consume_string(const char **buf)
char *out = av_malloc(strlen(*buf) + 1);
char *ret = out;
- *buf += consume_whitespace(*buf);
+ *buf += strspn(*buf, WHITESPACES);
do{
char c = *(*buf)++;
@@ -84,7 +81,7 @@ static char *consume_string(const char **buf)
} while(out[-1]);
(*buf)--;
- *buf += consume_whitespace(*buf);
+ *buf += strspn(*buf, WHITESPACES);
return ret;
}
@@ -283,7 +280,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
insert_inout(curr_inputs, match);
- *buf += consume_whitespace(*buf);
+ *buf += strspn(*buf, WHITESPACES);
pad++;
}
@@ -322,7 +319,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
input->name = name;
insert_inout(open_outputs, input);
}
- *buf += consume_whitespace(*buf);
+ *buf += strspn(*buf, WHITESPACES);
pad++;
}
@@ -340,7 +337,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
do {
AVFilterContext *filter;
- filters += consume_whitespace(filters);
+ filters += strspn(filters, WHITESPACES);
if(parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0)
goto fail;
@@ -364,7 +361,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
log_ctx) < 0)
goto fail;
- filters += consume_whitespace(filters);
+ filters += strspn(filters, WHITESPACES);
chr = *filters++;
if(chr == ';' && curr_inputs) {