avfilter/af_dynaudnorm: make better check for available samples

Also report more correct EOF timestamp.
This commit is contained in:
Paul B Mahol 2021-03-10 23:48:44 +01:00
parent 2ae73b74bb
commit 3e3c408e3f
1 changed files with 3 additions and 2 deletions

View File

@ -719,6 +719,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
cqueue_dequeue(s->is_enabled, &is_enabled);
amplify_frame(s, out, is_enabled > 0.);
s->pts = out->pts + out->nb_samples;
ret = ff_filter_frame(outlink, out);
}
@ -769,7 +770,7 @@ static int flush(AVFilterLink *outlink)
} else if (s->queue.available) {
AVFrame *out = ff_bufqueue_get(&s->queue);
s->pts = out->pts;
s->pts = out->pts + out->nb_samples;
ret = ff_filter_frame(outlink, out);
}
@ -797,7 +798,7 @@ static int activate(AVFilterContext *ctx)
return ret;
}
if (ff_inlink_queued_samples(inlink) >= s->frame_len) {
if (ff_inlink_check_available_samples(inlink, s->frame_len) > 0) {
ff_filter_set_ready(ctx, 10);
return 0;
}