Unified · Split
| @@ -99,6 +99,7 @@ typedef struct AudioStatsContext { · 98 unmodified lines | |||
| 99 | double time_constant; | 99 | double time_constant; |
| 100 | double mult; | 100 | double mult; |
| 101 | int metadata; | 101 | int metadata; |
| 102 | int used; | ||
| 102 | int reset_count; | 103 | int reset_count; |
| 103 | int nb_frames; | 104 | int nb_frames; |
| 104 | int maxbitdepth; | 105 | int maxbitdepth; |
| @@ -637,6 +638,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 532 unmodified lines | |||
| 637 | s->nb_frames++; | 638 | s->nb_frames++; |
| 638 | } | 639 | } |
| 639 | 640 | ||
| 641 | if (s->used == 0) | ||
| 642 | s->used = buf->nb_samples > 0; | ||
| 640 | ff_filter_execute(ctx, filter_channel, buf, NULL, | 643 | ff_filter_execute(ctx, filter_channel, buf, NULL, |
| 641 | FFMIN(inlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); | 644 | FFMIN(inlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); |
| 642 | 645 | ||
| @@ -668,7 +671,7 @@ static void print_stats(AVFilterContext *ctx) · 25 unmodified lines | |||
| 668 | for (c = 0; c < s->nb_channels; c++) { | 671 | for (c = 0; c < s->nb_channels; c++) { |
| 669 | ChannelStats *p = &s->chstats[c]; | 672 | ChannelStats *p = &s->chstats[c]; |
| 670 | 673 | ||
| 671 | if (p->nb_samples == 0 && ctx->outputs[0]->sample_count_in == 0) | 674 | if (p->nb_samples == 0 && !s->used) |
| 672 | continue; | 675 | continue; |
| 673 | 676 | ||
| 674 | if (p->nb_samples < s->tc_samples) | 677 | if (p->nb_samples < s->tc_samples) |
| @@ -757,7 +760,7 @@ static void print_stats(AVFilterContext *ctx) · 82 unmodified lines | |||
| 757 | av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals); | 760 | av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals); |
| 758 | } | 761 | } |
| 759 | 762 | ||
| 760 | if (nb_samples == 0 && ctx->outputs[0]->sample_count_in == 0) | 763 | if (nb_samples == 0 && !s->used) |
| 761 | return; | 764 | return; |
| 762 | 765 | ||
| 763 | if (s->measure_overall != MEASURE_NONE) | 766 | if (s->measure_overall != MEASURE_NONE) |