diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-11 11:15:40 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-18 17:50:17 +0100 |
commit | f74a4b621fed92f964ed58bae00721f8785fe90b (patch) | |
tree | f01501587a0650f2a64d63e9401a70ba592a018c | |
parent | 7fc9aa6d359e6c594a367e4db6366bc661581f56 (diff) | |
download | ffmpeg-f74a4b621fed92f964ed58bae00721f8785fe90b.tar.gz |
avfiltergraph: use meaningful error codes
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 59cef18c24ab21de4e652e130ac25905c1141f62)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavfilter/avfiltergraph.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index b503c366f8..af96807531 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -90,7 +90,7 @@ int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n", filt->input_pads[j].name, filt->name, filt->filter->name); - return -1; + return AVERROR(EINVAL); } } @@ -99,7 +99,7 @@ int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n", filt->output_pads[j].name, filt->name, filt->filter->name); - return -1; + return AVERROR(EINVAL); } } } @@ -178,7 +178,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Impossible to convert between the formats supported by the filter " "'%s' and the filter '%s'\n", link->src->name, link->dst->name); - return -1; + return AVERROR(EINVAL); } } } @@ -216,9 +216,11 @@ static void pick_formats(AVFilterGraph *graph) int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx) { + int ret; + /* find supported formats from sub-filters, and merge along links */ - if (query_formats(graph, log_ctx)) - return -1; + if ((ret = query_formats(graph, log_ctx)) < 0) + return ret; /* Once everything is merged, it's possible that we'll still have * multiple valid media format choices. We pick the first one. */ |