[FFmpeg-cvslog] avfilter/avfiltergraph: fix -Wunused-result warnings

Ganesh Ajjanagadde git at videolan.org
Sat Oct 17 03:59:33 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Wed Oct 14 22:26:38 2015 -0400| [3835554bf8ed78539a3492c239f979c0ab03a15f] | committer: Ganesh Ajjanagadde

avfilter/avfiltergraph: fix -Wunused-result warnings

Commit bf0d2d6030c239f91e0368a20fb2dc0705bfec99 introduced
av_warn_unused_result to avfilter/formats, whose associated warnings
were mostly fixed in 6aaac24d72a7da631173209841a3944fcb4a3309. This
fixes the issues in avfilter/avfiltergraph.

Tested with FATE.

Reviewed-by: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

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

 libavfilter/avfiltergraph.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index bc10665..d749250 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -745,7 +745,8 @@ do {                                                                   \
             fmts = out_link->in_ ## list;                              \
                                                                        \
             if (!out_link->in_ ## list->nb) {                          \
-                add_format(&out_link->in_ ##list, fmt);                \
+                if ((ret = add_format(&out_link->in_ ##list, fmt)) < 0)\
+                    return ret;                                        \
                 ret = 1;                                               \
                 break;                                                 \
             }                                                          \
@@ -811,16 +812,21 @@ static int reduce_formats_on_filter(AVFilterContext *filter)
     return ret;
 }
 
-static void reduce_formats(AVFilterGraph *graph)
+static int reduce_formats(AVFilterGraph *graph)
 {
-    int i, reduced;
+    int i, reduced, ret;
 
     do {
         reduced = 0;
 
-        for (i = 0; i < graph->nb_filters; i++)
-            reduced |= reduce_formats_on_filter(graph->filters[i]);
+        for (i = 0; i < graph->nb_filters; i++) {
+            if ((ret = reduce_formats_on_filter(graph->filters[i])) < 0)
+                return ret;
+            reduced |= ret;
+        }
     } while (reduced);
+
+    return 0;
 }
 
 static void swap_samplerates_on_filter(AVFilterContext *filter)
@@ -1138,7 +1144,8 @@ static int graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
     /* Once everything is merged, it's possible that we'll still have
      * multiple valid media format choices. We try to minimize the amount
      * of format conversion inside filters */
-    reduce_formats(graph);
+    if ((ret = reduce_formats(graph)) < 0)
+        return ret;
 
     /* for audio filters, ensure the best format, sample rate and channel layout
      * is selected */



More information about the ffmpeg-cvslog mailing list