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 ef3babb2c7
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/310/head
Nikolas Bowe via ffmpeg-devel 6 years ago committed by Michael Niedermayer
parent 8607e29fa3
commit 4c8e3725d9
  1. 8
      libavfilter/af_asetnsamples.c

@ -67,8 +67,12 @@ static int activate(AVFilterContext *ctx)
return ret; return ret;
if (ret > 0) { if (ret > 0) {
if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) {
return ff_filter_frame(outlink, frame); 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); pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples);
if (!pad_frame) { if (!pad_frame) {

Loading…
Cancel
Save