[FFmpeg-devel] [PATCH] avfilter: add loop filters

Stefano Sabatini stefasab at gmail.com
Sat Feb 13 16:01:08 CET 2016


On date Friday 2016-02-12 15:28:15 +0100, Paul B Mahol encoded:
> On 2/11/16, Paul B Mahol <onemda at gmail.com> wrote:
> > Hi,
> >
> > patch attached.
> >
> 
> Better version attached.

> From d953f78bffbf3db8f0209b41b189ece12b402afa Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda at gmail.com>
> Date: Thu, 11 Feb 2016 22:05:54 +0100
> Subject: [PATCH] avfilter: add loop filters
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/Makefile     |   2 +
>  libavfilter/allfilters.c |   2 +
>  libavfilter/f_loop.c     | 339 +++++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/audio_fifo.c   |  24 ++++
>  libavutil/audio_fifo.h   |  17 +++
[...]
> +int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset)
> +{
> +    int i, ret, size;
> +
> +    if (offset < 0 || offset >= af->nb_samples)
> +        return AVERROR(EINVAL);
> +    if (nb_samples < 0)
> +        return AVERROR(EINVAL);
> +    nb_samples = FFMIN(nb_samples, af->nb_samples);
> +    if (!nb_samples)
> +        return 0;

> +    if (offset > af->nb_samples - nb_samples)
> +        return AVERROR(EINVAL);

is this check really required, or could you have something like:
nb_samples = FFMIN(nb_samples, af->nb_samples - offset);

?

[...]
-- 
FFmpeg = Furious and Frightening Mournful Philosophical Ermetic Game


More information about the ffmpeg-devel mailing list