[Ffmpeg-devel] llrint() in Cygwin

Måns Rullgård mru
Fri Jan 26 16:02:48 CET 2007


Michael Niedermayer said:
> Hi
>
> On Fri, Jan 26, 2007 at 02:10:16PM -0000, M?ns Rullg?rd wrote:
>>
>> Thomas Raivio said:
>> > Hi,
>> >
>> > llrint() is not defined in Cygwin and the function is used in
>> > libavcodec/mpegaudiodec.c. I propose changing llrint() to rint() in this
>> > case.
>>
>> This needs to be fixed, but using rint() is not the correct solution.
>>
>> Could someone please investigate the actual range of the values involved?
>> Also, what is the correct rounding for these numbers?  The rint() family of
>> functions will round differently depending on application settings.
>>
>> It is quite possible that a simple (uint32_t)(x + 0.5) will do the right thing.
>
> no, not alone the current code rounds values up to 2241526806663124992.000000
> these entries in the LUT are likely never accessed but i dont have the time
> nor interrest to check which is the last which might be accessed by a valid
> (or even invalid) mp3 file

Well, anything that needs values outside the 32-bit range will be incorrectly
decoded with the current code.

> also note someone now thinking of finding the max for his mp3 collection no
> it wont be accepted this has to be checked by figuring out which values can
> be reached by looking at the code and or mp3 spec

Agreed.  Nevertheless, testing with a large number of files might turn up one
that does need a large value, rendering a thorough investigation unnecessary.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list