diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-30 19:07:19 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-10-30 19:07:19 +0100 |
commit | 89389b7ed47b70f98d27b84e2aae3343d92d9682 (patch) | |
tree | 3973532510fc8630226e61540af72571444ac29f | |
parent | 648b422e171d5eab18f6c6fd346e4050d717b936 (diff) | |
download | ffmpeg-89389b7ed47b70f98d27b84e2aae3343d92d9682.tar.gz |
avfilter/af_afade: check for eof after crossfade later
Fixes memleaks and #8346
-rw-r--r-- | libavfilter/af_afade.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index 10505caf1f..23608fb59b 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -454,7 +454,12 @@ static int activate(AVFilterContext *ctx) if (s->crossfade_is_over) { ret = ff_inlink_consume_frame(ctx->inputs[1], &in); - if (ret < 0) { + if (ret > 0) { + 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); + } else if (ret < 0) { return ret; } else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) { ff_outlink_set_status(ctx->outputs[0], status, pts); @@ -464,11 +469,6 @@ static int activate(AVFilterContext *ctx) 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); } } |