Commit 688b9dad authored by Stefano Sabatini's avatar Stefano Sabatini

Change the signature of parse_filter() to make it return an error code.

Originally committed as revision 25692 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c58572f8
...@@ -141,12 +141,11 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind ...@@ -141,12 +141,11 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
/** /**
* Parse "filter=params" * Parse "filter=params"
*/ */
static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,
int index, AVClass *log_ctx) int index, AVClass *log_ctx)
{ {
char *opts = NULL; char *opts = NULL;
char *name = av_get_token(buf, "=,;[\n"); char *name = av_get_token(buf, "=,;[\n");
AVFilterContext *filt_ctx;
int ret; int ret;
if (**buf == '=') { if (**buf == '=') {
...@@ -154,10 +153,10 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, ...@@ -154,10 +153,10 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph,
opts = av_get_token(buf, "[],;\n"); opts = av_get_token(buf, "[],;\n");
} }
ret = create_filter(&filt_ctx, graph, index, name, opts, log_ctx); ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
av_free(name); av_free(name);
av_free(opts); av_free(opts);
return filt_ctx; return ret;
} }
static void free_inout(AVFilterInOut *head) static void free_inout(AVFilterInOut *head)
...@@ -326,9 +325,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, ...@@ -326,9 +325,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
if (parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0) if (parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0)
goto fail; goto fail;
filter = parse_filter(&filters, graph, index, log_ctx); if (parse_filter(&filter, &filters, graph, index, log_ctx) < 0)
if (!filter)
goto fail; goto fail;
if (filter->input_count == 1 && !curr_inputs && !index) { if (filter->input_count == 1 && !curr_inputs && !index) {
......
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