History

avfiltergraph: use meaningful error codes

Stefano Sabatini committed 15 years ago

Commit f5901fd1 parent 7aa59471 file · +7 −5Browse files

Unified · Split

libavfilter/avfiltergraph.c+7−5
@@ -90,7 +90,7 @@ int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 89 unmodified lines
9090 av_log(log_ctx, AV_LOG_ERROR,
9191 "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n",
9292 filt->input_pads[j].name, filt->name, filt->filter->name);
93− return -1;
93+ return AVERROR(EINVAL);
9494 }
9595 }
9696
@@ -99,7 +99,7 @@ int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 2 unmodified lines
9999 av_log(log_ctx, AV_LOG_ERROR,
100100 "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n",
101101 filt->output_pads[j].name, filt->name, filt->filter->name);
102− return -1;
102+ return AVERROR(EINVAL);
103103 }
104104 }
105105 }
@@ -178,7 +178,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 72 unmodified lines
178178 av_log(log_ctx, AV_LOG_ERROR,
179179 "Impossible to convert between the formats supported by the filter "
180180 "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
181− return -1;
181+ return AVERROR(EINVAL);
182182 }
183183 }
184184 }
@@ -216,9 +216,11 @@ static void pick_formats(AVFilterGraph *graph) · 31 unmodified lines
216216
217217 int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
218218 {
219+ int ret;
220+
219221 /* find supported formats from sub-filters, and merge along links */
220− if (query_formats(graph, log_ctx))
221− return -1;
222+ if ((ret = query_formats(graph, log_ctx)) < 0)
223+ return ret;
222224
223225 /* Once everything is merged, it's possible that we'll still have
224226 * multiple valid media format choices. We pick the first one. */

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