summaryrefslogtreecommitdiff
path: root/libavfilter/af_astats.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-archive.com>2021-03-25 17:26:37 +0100
committerTobias Rapp <t.rapp@noa-archive.com>2021-07-14 10:31:33 +0200
commitca56299fb3f71badee457c4c36a893f626c4a274 (patch)
tree1078acab21a70def073eec3882b13d73ea2fceb1 /libavfilter/af_astats.c
parentf531a1a4e8f5bbc66d6077efe3b4f90f76cc5f51 (diff)
downloadffmpeg-ca56299fb3f71badee457c4c36a893f626c4a274.tar.gz
avfilter/af_astats: Only print header lines when values are to be printed
Avoids empty "Channel" or "Overall" header lines added to log output when measurement is restricted to one scope using "measure_perchannel=none" or "measure_overall=none". Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Diffstat (limited to 'libavfilter/af_astats.c')
-rw-r--r--libavfilter/af_astats.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 51a01aba2f..23a5785d5a 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -705,7 +705,8 @@ static void print_stats(AVFilterContext *ctx)
if (fabs(p->sigma_x) > fabs(max_sigma_x))
max_sigma_x = p->sigma_x;
- av_log(ctx, AV_LOG_INFO, "Channel: %d\n", c + 1);
+ if (s->measure_perchannel != MEASURE_NONE)
+ av_log(ctx, AV_LOG_INFO, "Channel: %d\n", c + 1);
if (s->measure_perchannel & MEASURE_DC_OFFSET)
av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);
if (s->measure_perchannel & MEASURE_MIN_LEVEL)
@@ -757,7 +758,8 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);
}
- av_log(ctx, AV_LOG_INFO, "Overall\n");
+ if (s->measure_overall != MEASURE_NONE)
+ av_log(ctx, AV_LOG_INFO, "Overall\n");
if (s->measure_overall & MEASURE_DC_OFFSET)
av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
if (s->measure_overall & MEASURE_MIN_LEVEL)