avfilter/af_asetnsamples: fix excessive frames queueing at start

release/5.1
Paul B Mahol 3 years ago
parent b64043a83d
commit 25cd1845ab
  1. 12
      libavfilter/af_asetnsamples.c

@ -66,12 +66,8 @@ static int activate(AVFilterContext *ctx)
return ret;
if (ret > 0) {
if (!s->pad || frame->nb_samples == s->nb_out_samples) {
ret = ff_filter_frame(outlink, frame);
if (ff_inlink_queued_samples(inlink) >= s->nb_out_samples)
ff_filter_set_ready(ctx, 100);
return ret;
}
if (!s->pad || frame->nb_samples == s->nb_out_samples)
return ff_filter_frame(outlink, frame);
pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples);
if (!pad_frame) {
@ -96,6 +92,10 @@ static int activate(AVFilterContext *ctx)
}
FF_FILTER_FORWARD_STATUS(inlink, outlink);
if (ff_inlink_queued_samples(inlink) >= s->nb_out_samples) {
ff_filter_set_ready(ctx, 100);
return 0;
}
FF_FILTER_FORWARD_WANTED(outlink, inlink);
return FFERROR_NOT_READY;

Loading…
Cancel
Save