On Sun, Aug 23, 2015 at 02:28:07PM -0400, Ganesh Ajjanagadde wrote:
> This fixes a -Wabsolute-value reported by clang 3.5+ complaining about misuse 
> of fabs() for integer absolute value.
> An additional benefit is the removal of floating point calculations.
> Note that the behaviors are not exactly identical, but should be ok in most 
> situations.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanaga...@gmail.com>
> ---
>  libswresample/dither.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libswresample/dither.c b/libswresample/dither.c
> index 248062a..fc08932 100644
> --- a/libswresample/dither.c
> +++ b/libswresample/dither.c
> @@ -109,7 +109,7 @@ av_cold int swri_dither_init(SwrContext *s, enum 
> AVSampleFormat out_fmt, enum AV
>      memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
>      for (i=0; filters[i].coefs; i++) {
>          const filter_t *f = &filters[i];
> -        if (fabs(s->out_sample_rate - f->rate) / f->rate <= .05 && f->name 
> == s->dither.method) {
> +        if ((abs(s->out_sample_rate - f->rate) <= f->rate / 20) && f->name 
> == s->dither.method) {

unneeded () and the identical  condition should be used if possible

something like
llabs(s->out_sample_rate - f->rate) * 20 <= f->rate

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

What does censorship reveal? It reveals fear. -- Julian Assange

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to