avfilter/af_afade: make sure that in is available

This commit is contained in:
Paul B Mahol 2019-10-16 00:45:26 +02:00
parent 2558e62713
commit 29dac2927f

View File

@ -459,16 +459,17 @@ static int activate(AVFilterContext *ctx)
} else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) { } else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) {
ff_outlink_set_status(ctx->outputs[0], status, pts); ff_outlink_set_status(ctx->outputs[0], status, pts);
return 0; return 0;
} else { } else if (!ret) {
if (ff_outlink_frame_wanted(ctx->outputs[0]) && !in) { if (ff_outlink_frame_wanted(ctx->outputs[0])) {
ff_inlink_request_frame(ctx->inputs[1]); ff_inlink_request_frame(ctx->inputs[1]);
return 0; return 0;
} }
} else {
in->pts = s->pts;
s->pts += av_rescale_q(in->nb_samples,
(AVRational){ 1, outlink->sample_rate }, outlink->time_base);
return ff_filter_frame(outlink, in);
} }
in->pts = s->pts;
s->pts += av_rescale_q(in->nb_samples,
(AVRational){ 1, outlink->sample_rate }, outlink->time_base);
return ff_filter_frame(outlink, in);
} }
if (ff_inlink_queued_samples(ctx->inputs[0]) > s->nb_samples) { if (ff_inlink_queued_samples(ctx->inputs[0]) > s->nb_samples) {