[FFmpeg-devel] [PATCH 2/2] avfilter: add showspectrumpic filter

Paul B Mahol onemda at gmail.com
Fri Jan 1 14:37:54 CET 2016


On 1/1/16, Paul B Mahol <onemda at gmail.com> wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  doc/filters.texi               | 106 +++++++++++++++++++
>  libavfilter/Makefile           |   1 +
>  libavfilter/allfilters.c       |   1 +
>  libavfilter/avf_showspectrum.c | 233
> ++++++++++++++++++++++++++++++++++++++---
>  4 files changed, 326 insertions(+), 15 deletions(-)
>

[...]

> +        if (samples / sz < s->win_size) {
> +            spf = lrint(ceil(samples / (float)sz)) % s->win_size;
> +            spb = samples / sz;
> +        } else {
> +            spf = samples % s->win_size;
> +            spb = samples / sz;

Fixed those calculations locally.

> +        }
> +
> +        if (!spf)
> +            spf = s->win_size;
> +        s->sliding = FULLFRAME;
> +        fin = ff_get_audio_buffer(inlink, s->win_size);
> +        if (!fin)

[...]


More information about the ffmpeg-devel mailing list