[FFmpeg-cvslog] avfilter: Return more meaningful error codes

Himangi Saraogi git at videolan.org
Fri Mar 6 01:26:22 CET 2015


ffmpeg | branch: master | Himangi Saraogi <himangi774 at gmail.com> | Mon Feb 23 10:09:16 2015 +0530| [88b160a457e491cb9e014630ef5387ad3500258e] | committer: Diego Biurrun

avfilter: Return more meaningful error codes

Signed-off-by: Diego Biurrun <diego at biurrun.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88b160a457e491cb9e014630ef5387ad3500258e
---

 libavfilter/avfilter.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 4098973..fd73cd0 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -79,7 +79,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
 
     if (src->nb_outputs <= srcpad || dst->nb_inputs <= dstpad ||
         src->outputs[srcpad]      || dst->inputs[dstpad])
-        return -1;
+        return AVERROR(EINVAL);
 
     if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) {
         av_log(src, AV_LOG_ERROR,
@@ -254,7 +254,8 @@ int ff_request_frame(AVFilterLink *link)
         return link->srcpad->request_frame(link);
     else if (link->src->inputs[0])
         return ff_request_frame(link->src->inputs[0]);
-    else return -1;
+    else
+        return AVERROR(EINVAL);
 }
 
 int ff_poll_frame(AVFilterLink *link)
@@ -267,7 +268,7 @@ int ff_poll_frame(AVFilterLink *link)
     for (i = 0; i < link->src->nb_inputs; i++) {
         int val;
         if (!link->src->inputs[i])
-            return -1;
+            return AVERROR(EINVAL);
         val = ff_poll_frame(link->src->inputs[i]);
         min = FFMIN(min, val);
     }



More information about the ffmpeg-cvslog mailing list