[FFmpeg-devel] [PATCH] Change round to rint in atrac3.c

Måns Rullgård mans
Mon Oct 15 09:51:41 CEST 2007

Fred Rothganger <fred at rothganger.org> writes:

> I am compiling ffmpeg under cygwin with -mno-cygwin, and then linking
> the resulting static libs under MSVC 2005 edition.  There are three
> symbols that remain undefined at link time:
> _snprintf
> _gettimeofday
> _round
> This patch addresses _round.  Don't know what the efficiency impact is
> of using rint() and cast rather than round().

It's not only a matter of efficiency, it's also a matter of
correctness.  Using rint() here is plain wrong for several reasons.
Firstly, rint() uses the current rounding direction, which we have no
control over, thus making the exact output unpredictable.  Secondly,
rint() raises the inexact exception when the argument is not an

Just get a C99-compatible libc and be done with it.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list