From fa7afd17c586d217593aff410d39cdb73e0e5d30 Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Fri, 30 Mar 2018 22:22:13 +0200
Subject: [PATCH 4/7] avfilter/showvolume : clear buffer at each frame

fix update peak display when peak level decrease
---
 libavfilter/avf_showvolume.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index 6c47cce19f..806afe5608 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -262,7 +262,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
             av_frame_free(&insamples);
             return AVERROR(ENOMEM);
         }
-
+    }
         for (i = 0; i < outlink->h; i++) {
             uint32_t *dst = (uint32_t *)(s->out->data[0] + i * s->out->linesize[0]);
             const uint32_t bg = (uint32_t)(s->bgopacity * 255) << 24;
@@ -270,7 +270,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
             for (j = 0; j < outlink->w; j++)
                 AV_WN32A(dst + j, bg);
         }
-    }
     s->out->pts = insamples->pts;
 
     if (s->f < 1.) {
-- 
2.14.3 (Apple Git-98)

