[FFmpeg-devel] [PATCH] avfilter/af_anequalizer: Avoid loss of precision when calculating nyquist frequency

Paul B Mahol onemda at gmail.com
Fri Feb 12 09:18:13 CET 2016


On 2/12/16, Michael Niedermayer <michael at niedermayer.cc> wrote:
> Fixes: CID1351398
> Fixes: CID1351400
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavfilter/af_anequalizer.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c
> index b646814..a344c77 100644
> --- a/libavfilter/af_anequalizer.c
> +++ b/libavfilter/af_anequalizer.c
> @@ -610,7 +610,7 @@ static int config_input(AVFilterLink *inlink)
>          }
>
>          if (s->filters[s->nb_filters].freq < 0 ||
> -            s->filters[s->nb_filters].freq > inlink->sample_rate / 2)
> +            s->filters[s->nb_filters].freq > inlink->sample_rate / 2.0)
>              s->filters[s->nb_filters].ignore = 1;
>
>          if (s->filters[s->nb_filters].channel < 0 ||
> @@ -645,7 +645,7 @@ static int process_command(AVFilterContext *ctx, const
> char *cmd, const char *ar
>          if (filter < 0 || filter >= s->nb_filters)
>              return AVERROR(EINVAL);
>
> -        if (freq < 0 || freq > inlink->sample_rate / 2)
> +        if (freq < 0 || freq > inlink->sample_rate / 2.0)
>              return AVERROR(EINVAL);
>
>          s->filters[filter].freq  = freq;
> --
> 1.7.9.5
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

ok


More information about the ffmpeg-devel mailing list