History

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

Stefano Sabatini committed 16 years ago

Commit 688b9da1 parent c58572f1 file · +5 −8Browse files

Unified · Split

libavfilter/graphparser.c+5−8
@@ -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 */
144static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph,144static 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
163static void free_inout(AVFilterInOut *head)162static 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) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t