[FFmpeg-devel] [FFmpeg-cvslog] avfilter/af_agate: switch to activate

Nicolas George george at nsup.org
Thu Aug 31 18:38:12 EEST 2017

L'octidi 8 fructidor, an CCXXV, Paul B Mahol a écrit :
> +    if ((ret = ff_inlink_consume_frame(ctx->inputs[0], &in[0])) > 0) {
> +        av_audio_fifo_write(s->fifo[0], (void **)in[0]->extended_data,
> +                            in[0]->nb_samples);
> +        av_frame_free(&in[0]);
> +    }
> +    if (ret < 0)
> +        return ret;
> +    if ((ret = ff_inlink_consume_frame(ctx->inputs[1], &in[1])) > 0) {
> +        av_audio_fifo_write(s->fifo[1], (void **)in[1]->extended_data,
> +                            in[1]->nb_samples);
> +        av_frame_free(&in[1]);
> +    }
> +    if (ret < 0)
> +        return ret;

Just to be sure all is explained correctly:

With this patch, you are certainly enhancing the scheduling, but it is
not taking full advantage of the new design: with activate(), all links
have a frame FIFO with unlimited capacity (and plans to add options to
manage that capacity globally). In this snippet of code, you move the
frames from this FIFO into another FIFO built in the private context. In
other words, you are nullifying the benefit of the link's built-in FIFO.

A complete conversion to activate() would require working from the
link's FIFO directly, and getting rid of the code with AVAudioFifo

It is more work, and since it works that way it is fine to leave it for
later and reap the easy benefits immediately. But I wanted to make sure
you were aware of that.

The same applies to af_sidechaincompress.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170831/e2411b28/attachment.sig>

More information about the ffmpeg-devel mailing list