[FFmpeg-cvslog] avfilter/af_astats: fix reporting of noise_floor for small number of samples

Paul B Mahol git at videolan.org
Sun Aug 13 15:39:12 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Aug 13 14:36:10 2023 +0200| [a5b334e18e362f76c82a5df206bc9198be53f8b5] | committer: Paul B Mahol

avfilter/af_astats: fix reporting of noise_floor for small number of samples

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

 libavfilter/af_astats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 16d427cca6..c47bd768cc 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -409,9 +409,9 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d,
     }
     p->nb_samples++;
 
+    noise_floor = calc_noise_floor(p->sorted_samples, nd, drop,
+                                   s->tc_samples, &p->sorted_front, &p->sorted_back);
     if (p->nb_samples >= s->tc_samples) {
-        noise_floor = calc_noise_floor(p->sorted_samples, nd, drop,
-                                       s->tc_samples, &p->sorted_front, &p->sorted_back);
         if (isnan(p->noise_floor)) {
             p->noise_floor = noise_floor;
             p->noise_floor_count = 1;



More information about the ffmpeg-cvslog mailing list