1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Make consume_whitespace() return a number of bytes to be skiped

Commited in SoC by Vitor Sessak on 2008-05-24 12:50:32

Originally committed as revision 13341 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2008-05-24 20:41:36 +00:00
parent 8e74c889bc
commit d424e138d1

View File

@ -41,9 +41,9 @@ static int link_filter(AVFilterContext *src, int srcpad,
return 0; return 0;
} }
static void consume_whitespace(const char **buf) static int consume_whitespace(const char *buf)
{ {
*buf += strspn(*buf, " \n\t"); return strspn(buf, " \n\t");
} }
/** /**
@ -55,7 +55,7 @@ static char *consume_string(const char **buf)
char *out = av_malloc(strlen(*buf) + 1); char *out = av_malloc(strlen(*buf) + 1);
char *ret = out; char *ret = out;
consume_whitespace(buf); *buf += consume_whitespace(*buf);
do{ do{
char c = *(*buf)++; char c = *(*buf)++;
@ -84,7 +84,7 @@ static char *consume_string(const char **buf)
} while(out[-1]); } while(out[-1]);
(*buf)--; (*buf)--;
consume_whitespace(buf); *buf += consume_whitespace(*buf);
return ret; return ret;
} }
@ -288,7 +288,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
} }
link_to_add->next = *currInputs; link_to_add->next = *currInputs;
*currInputs = link_to_add; *currInputs = link_to_add;
consume_whitespace(buf); *buf += consume_whitespace(*buf);
pad++; pad++;
} }
@ -335,7 +335,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs,
input->name = name; input->name = name;
*openLinks = input; *openLinks = input;
} }
consume_whitespace(buf); *buf += consume_whitespace(*buf);
pad++; pad++;
} }
@ -356,7 +356,7 @@ int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
do { do {
AVFilterContext *filter; AVFilterContext *filter;
consume_whitespace(&filters); filters += consume_whitespace(filters);
pad = parse_inputs(&filters, &currInputs, &openLinks, log_ctx); pad = parse_inputs(&filters, &currInputs, &openLinks, log_ctx);
@ -382,7 +382,7 @@ int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
if(pad < 0) if(pad < 0)
goto fail; goto fail;
consume_whitespace(&filters); filters += consume_whitespace(filters);
chr = *filters++; chr = *filters++;
if(chr == ';' && currInputs) { if(chr == ';' && currInputs) {