History

avfilter/af_dynaudnorm: process also short durations

Paul B Mahol committed 4 years ago

Commit 4a672f11 parent 4dda3b11 file · +4 −10Browse files

Unified · Split

libavfilter/af_dynaudnorm.c+4−10
@@ -824,19 +824,13 @@ static int flush(AVFilterLink *outlink) · 823 unmodified lines
824824 AVFilterContext *ctx = outlink->src;
825825 AVFilterLink *inlink = ctx->inputs[0];
826826 DynamicAudioNormalizerContext *s = ctx->priv;
827− int ret = 0;
828827
829− if (!cqueue_empty(s->gain_history_smoothed[0])) {
830− ret = flush_buffer(s, inlink, outlink);
831− } else if (s->queue.available) {
832− AVFrame *out = ff_bufqueue_get(&s->queue);
833−
834− s->pts = out->pts + av_rescale_q(out->nb_samples, av_make_q(1, outlink->sample_rate),
835− outlink->time_base);
836− ret = ff_filter_frame(outlink, out);
828+ while (s->eof && cqueue_empty(s->gain_history_smoothed[0])) {
829+ for (int c = 0; c < s->channels; c++)
830+ update_gain_history(s, c, (local_gain){ cqueue_peek(s->gain_history_original[c], 0), 1.0});
837831 }
838832
839− return ret;
833+ return flush_buffer(s, inlink, outlink);
840834 }
841835
842836 static int activate(AVFilterContext *ctx)

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