diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-03-10 23:48:44 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-03-10 23:52:07 +0100 |
commit | 3e3c408e3fc9ba3ad861e1d3aea22f9e8c1a3894 (patch) | |
tree | 18a291b1b42f8aa0f41b1c0f2a6ce0e4113b7102 | |
parent | 2ae73b74bbb41bf6a5fe4d2174eec29a68761166 (diff) | |
download | ffmpeg-3e3c408e3fc9ba3ad861e1d3aea22f9e8c1a3894.tar.gz |
avfilter/af_dynaudnorm: make better check for available samples
Also report more correct EOF timestamp.
-rw-r--r-- | libavfilter/af_dynaudnorm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index 365453d60d..81fa62b69d 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -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; } |