avfilter/af_rubberband: fix sample overqueueing

Fixes #8389
This commit is contained in:
Paul B Mahol 2019-11-20 13:05:50 +01:00
parent e21d4a7ca4
commit a16de215c9

View File

@ -121,8 +121,9 @@ static int query_formats(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
RubberBandContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFilterContext *ctx = inlink->dst;
RubberBandContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out;
int ret = 0, nb_samples;
@ -149,7 +150,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
av_frame_free(&in);
return ret < 0 ? ret : nb_samples;
if (ff_inlink_queued_samples(inlink) >= s->nb_samples)
ff_filter_set_ready(ctx, 100);
return ret < 0 ? ret : nb_samples;
}
static int config_input(AVFilterLink *inlink)