History

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".

Tobias Rapp committed 5 years ago

Commit ca562991 parent f531a1a1 file · +4 −2Browse files

Unified · Split

libavfilter/af_astats.c+4−2
@@ -705,7 +705,8 @@ static void print_stats(AVFilterContext *ctx) · 704 unmodified lines
705 if (fabs(p->sigma_x) > fabs(max_sigma_x))705 if (fabs(p->sigma_x) > fabs(max_sigma_x))
706 max_sigma_x = p->sigma_x;706 max_sigma_x = p->sigma_x;
707 707
708 av_log(ctx, AV_LOG_INFO, "Channel: %d\n", c + 1);708 if (s->measure_perchannel != MEASURE_NONE)
709 av_log(ctx, AV_LOG_INFO, "Channel: %d\n", c + 1);
709 if (s->measure_perchannel & MEASURE_DC_OFFSET)710 if (s->measure_perchannel & MEASURE_DC_OFFSET)
710 av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);711 av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);
711 if (s->measure_perchannel & MEASURE_MIN_LEVEL)712 if (s->measure_perchannel & MEASURE_MIN_LEVEL)
@@ -757,7 +758,8 @@ static void print_stats(AVFilterContext *ctx) · 45 unmodified lines
757 av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);758 av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);
758 }759 }
759 760
760 av_log(ctx, AV_LOG_INFO, "Overall\n");761 if (s->measure_overall != MEASURE_NONE)
762 av_log(ctx, AV_LOG_INFO, "Overall\n");
761 if (s->measure_overall & MEASURE_DC_OFFSET)763 if (s->measure_overall & MEASURE_DC_OFFSET)
762 av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));764 av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
763 if (s->measure_overall & MEASURE_MIN_LEVEL)765 if (s->measure_overall & MEASURE_MIN_LEVEL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t