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".
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -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) |