Originally committed as revision 25692 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/graphparser.c (1 of 1 file). Show all
Unified · Split
| @@ -141,12 +141,11 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind · 140 unmodified lines | |||
| 141 | /** | 141 | /** |
| 142 | * Parse "filter=params" | 142 | * Parse "filter=params" |
| 143 | */ | 143 | */ |
| 144 | static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, | 144 | static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph, |
| 145 | int index, AVClass *log_ctx) | 145 | int index, AVClass *log_ctx) |
| 146 | { | 146 | { |
| 147 | char *opts = NULL; | 147 | char *opts = NULL; |
| 148 | char *name = av_get_token(buf, "=,;[\n"); | 148 | char *name = av_get_token(buf, "=,;[\n"); |
| 149 | AVFilterContext *filt_ctx; | ||
| 150 | int ret; | 149 | int ret; |
| 151 | 150 | ||
| 152 | if (**buf == '=') { | 151 | if (**buf == '=') { |
| @@ -154,10 +153,10 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, · 1 unmodified line | |||
| 154 | opts = av_get_token(buf, "[],;\n"); | 153 | opts = av_get_token(buf, "[],;\n"); |
| 155 | } | 154 | } |
| 156 | 155 | ||
| 157 | ret = create_filter(&filt_ctx, graph, index, name, opts, log_ctx); | 156 | ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx); |
| 158 | av_free(name); | 157 | av_free(name); |
| 159 | av_free(opts); | 158 | av_free(opts); |
| 160 | return filt_ctx; | 159 | return ret; |
| 161 | } | 160 | } |
| 162 | 161 | ||
| 163 | static void free_inout(AVFilterInOut *head) | 162 | static void free_inout(AVFilterInOut *head) |
| @@ -326,9 +325,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, · 162 unmodified lines | |||
| 326 | if (parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0) | 325 | if (parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0) |
| 327 | goto fail; | 326 | goto fail; |
| 328 | 327 | ||
| 329 | filter = parse_filter(&filters, graph, index, log_ctx); | 328 | if (parse_filter(&filter, &filters, graph, index, log_ctx) < 0) |
| 330 | |||
| 331 | if (!filter) | ||
| 332 | goto fail; | 329 | goto fail; |
| 333 | 330 | ||
| 334 | if (filter->input_count == 1 && !curr_inputs && !index) { | 331 | if (filter->input_count == 1 && !curr_inputs && !index) { |