diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-16 00:45:26 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-10-16 00:59:30 +0200 |
commit | 29dac2927f5fa0b1f5c6b27a3ed32f2968ea9b00 (patch) | |
tree | eb26401547887f3c74f9d292818efe63a8014704 /libavfilter/af_afade.c | |
parent | 2558e62713ebc5f3ea22c1a28d8e9cf3249badaf (diff) | |
download | ffmpeg-29dac2927f5fa0b1f5c6b27a3ed32f2968ea9b00.tar.gz |
avfilter/af_afade: make sure that in is available
Diffstat (limited to 'libavfilter/af_afade.c')
-rw-r--r-- | libavfilter/af_afade.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index 0c43b2233d..10505caf1f 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -459,16 +459,17 @@ static int activate(AVFilterContext *ctx) } else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) { ff_outlink_set_status(ctx->outputs[0], status, pts); return 0; - } else { - if (ff_outlink_frame_wanted(ctx->outputs[0]) && !in) { + } else if (!ret) { + if (ff_outlink_frame_wanted(ctx->outputs[0])) { ff_inlink_request_frame(ctx->inputs[1]); 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) { |