[FFmpeg-devel] [PATCH] avfilter/tremolo: fix wavetable buffer size

Michael Niedermayer michael at niedermayer.cc
Thu Oct 29 18:32:38 CET 2015


On Thu, Oct 29, 2015 at 12:48:05PM +0100, Paul B Mahol wrote:
> On 10/29/15, Kyle Swanson <k at ylo.ph> wrote:
> > Signed-off-by: Kyle Swanson <k at ylo.ph>
> > ---
> >  libavfilter/af_tremolo.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c
> > index 50df2e4..572e9e3 100644
> > --- a/libavfilter/af_tremolo.c
> > +++ b/libavfilter/af_tremolo.c
> > @@ -72,7 +72,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> >          dst += channels;
> >          src += channels;
> >          s->index++;
> > -        if (s->index >= inlink->sample_rate)
> > +        if (s->index >= inlink->sample_rate / s->freq)
> >              s->index = 0;
> >      }
> >
> > @@ -125,11 +125,11 @@ static int config_input(AVFilterLink *inlink)
> >      const double offset = 1. - s->depth / 2.;
> >      int i;
> >
> > -    s->table = av_malloc_array(inlink->sample_rate, sizeof(*s->table));
> > +    s->table = av_malloc_array(inlink->sample_rate / s->freq,
> > sizeof(*s->table));
> >      if (!s->table)
> >          return AVERROR(ENOMEM);
> >
> > -    for (i = 0; i < inlink->sample_rate; i++) {
> > +    for (i = 0; i < inlink->sample_rate / s->freq; i++) {
> >          double env = s->freq * i / inlink->sample_rate;
> >          env = sin(2 * M_PI * fmod(env + 0.25, 1.0));
> >          s->table[i] = env * (1 - fabs(offset)) + offset;
> > --
> > 2.6.2
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> probably ok

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151029/f89ab577/attachment.sig>


More information about the ffmpeg-devel mailing list