diff options
author | Nikolas Bowe via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> | 2019-04-06 03:11:15 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-04-07 14:17:34 +0300 |
commit | 4c8e3725d9ffe4baa5b5e3adec06aa2e68a89455 (patch) | |
tree | 93ddeb432eea4b04fb94e88e0a66c5b8c58ff231 | |
parent | 8607e29fa3d4e88496279067ab2ed8022219e644 (diff) |
avfilter/af_asetnsamples: fix sample queuing.
When asetnsamples uses output samples < input samples, remaining samples build up in the fifo over time.
Fix this by marking the filter as ready again if there are enough samples.
Regression since ef3babb2c70f564dc1634b3f29c6e35a2b2dc239
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavfilter/af_asetnsamples.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c index c60ce3063f..cab02d56f6 100644 --- a/libavfilter/af_asetnsamples.c +++ b/libavfilter/af_asetnsamples.c @@ -67,8 +67,12 @@ static int activate(AVFilterContext *ctx) return ret; if (ret > 0) { - if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) - return ff_filter_frame(outlink, frame); + if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) { + ret = ff_filter_frame(outlink, frame); + if (ff_framequeue_queued_samples(inlink) >= s->nb_out_samples) + ff_filter_set_ready(ctx, 100); + return ret; + } pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples); if (!pad_frame) { |