diff mbox series

[FFmpeg-devel,1/2] avfilter/af_astats: Only print header lines when values are to be printed

Message ID 1616763487-10025-1-git-send-email-t.rapp@noa-archive.com
State Accepted
Commit ca56299fb3f71badee457c4c36a893f626c4a274
Headers show
Series [FFmpeg-devel,1/2] avfilter/af_astats: Only print header lines when values are to be printed | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Tobias Rapp March 26, 2021, 12:58 p.m. UTC
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>
---
 libavfilter/af_astats.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Tobias Rapp April 6, 2021, 7:14 a.m. UTC | #1
On 26.03.2021 13:58, Tobias Rapp wrote:
> 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>
> ---
>   libavfilter/af_astats.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> [...]

A gentle ping for both patches. I'm putting Paul on CC as he seems to be 
the author of the most recent changes.

Regards,
Tobias
Paul B Mahol April 7, 2021, 5:25 p.m. UTC | #2
Please ask someone else to apply it.

On Tue, Apr 6, 2021 at 9:14 AM Tobias Rapp <t.rapp@noa-archive.com> wrote:

> On 26.03.2021 13:58, Tobias Rapp wrote:
> > 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>
> > ---
> >   libavfilter/af_astats.c | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > [...]
>
> A gentle ping for both patches. I'm putting Paul on CC as he seems to be
> the author of the most recent changes.
>
> Regards,
> Tobias
>
>
Tobias Rapp April 8, 2021, 6:41 a.m. UTC | #3
On 07.04.2021 19:25, Paul B Mahol wrote:
> Please ask someone else to apply it.

I can technically commit the patches but would prefer if some second 
pair of eyes could take a look. So will apply them in a week from now if 
nobody objects.

Regards,
Tobias
Tobias Rapp July 14, 2021, 8:47 a.m. UTC | #4
On 08.04.2021 08:41, Tobias Rapp wrote:
> On 07.04.2021 19:25, Paul B Mahol wrote:
>> Please ask someone else to apply it.
> 
> I can technically commit the patches but would prefer if some second 
> pair of eyes could take a look. So will apply them in a week from now if 
> nobody objects.

Applied this first part of the patch-set as it seemed non-controversial.

Regards,
Tobias
diff mbox series

Patch

diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index f50cbe1..c13df62 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)