[FFmpeg-devel] acrossfade filter crossfading before first input is exhausted

Paul B Mahol onemda at gmail.com
Thu Oct 31 12:02:09 EET 2019


Done,

On 10/30/19, Mark Niebur <mniebur at thuuz.com> wrote:
> Hello,
> I have been trying to use acrossfade but have been experiencing that the
> audio in the resulting output is totally jumbled.  From stepping through the
> code, it appears that acrossfade is starting the crossfade before the first
> input is exhausted.  I'm not sure why this happens from ffmpeg's point of
> view; I'm guessing it's from poor disk performance in docker.  I have found
> that the following patch fixes this issue:
>
> diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
> index 23608fb..91a454b 100644
> --- a/libavfilter/af_afade.c
> +++ b/libavfilter/af_afade.c
> @@ -485,7 +485,8 @@ static int activate(AVFilterContext *ctx)
>              (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
>          return ff_filter_frame(outlink, in);
>      } else if (ff_inlink_queued_samples(ctx->inputs[0]) >= s->nb_samples &&
> -               ff_inlink_queued_samples(ctx->inputs[1]) >= s->nb_samples) {
> +               ff_inlink_queued_samples(ctx->inputs[1]) >= s->nb_samples &&
> +               s->cf0_eof) {
>          if (s->overlap) {
>              out = ff_get_audio_buffer(outlink, s->nb_samples);
>              if (!out)
>
> Could you please merge this patch or merge a similar fix?
>
> Thanks,
> Mark Niebur
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list