History

avfilter/af_astats: do not give output for 0 samples

Paul B Mahol committed 3 years ago

Commit 14e6ca11 parent 569b1a21 file · +6 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_astats.c+6−0
@@ -668,6 +668,9 @@ static void print_stats(AVFilterContext *ctx) · 667 unmodified lines
668 for (c = 0; c < s->nb_channels; c++) {668 for (c = 0; c < s->nb_channels; c++) {
669 ChannelStats *p = &s->chstats[c];669 ChannelStats *p = &s->chstats[c];
670 670
671 if (p->nb_samples == 0)
672 continue;
673
671 if (p->nb_samples < s->tc_samples)674 if (p->nb_samples < s->tc_samples)
672 p->min_sigma_x2 = p->max_sigma_x2 = p->sigma_x2 / p->nb_samples;675 p->min_sigma_x2 = p->max_sigma_x2 = p->sigma_x2 / p->nb_samples;
673 676
@@ -754,6 +757,9 @@ static void print_stats(AVFilterContext *ctx) · 80 unmodified lines
754 av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);757 av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);
755 }758 }
756 759
760 if (nb_samples == 0)
761 return;
762
757 if (s->measure_overall != MEASURE_NONE)763 if (s->measure_overall != MEASURE_NONE)
758 av_log(ctx, AV_LOG_INFO, "Overall\n");764 av_log(ctx, AV_LOG_INFO, "Overall\n");
759 if (s->measure_overall & MEASURE_DC_OFFSET)765 if (s->measure_overall & MEASURE_DC_OFFSET)

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