1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avfilter/af_anequalizer: Avoid loss of precision when calculating nyquist frequency

Fixes: CID1351398
Fixes: CID1351400

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-02-12 00:55:49 +01:00
parent f9f684c0fb
commit 817bf8483e

View File

@ -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;