[Ffmpeg-devel] Use of llrint() in mpegaudiodec.c

Måns Rullgård mru
Tue Nov 28 23:53:24 CET 2006


Benjamin Larsson <banan at student.ltu.se> writes:

> M?ns Rullg?rd wrote:
>
>>In mpegaudiodec.c there are two calls to llrint().  This function
>>isn't available on some platforms, so linking fails there.  Looking
>>closer, I notice that in both cases, the return value is immediately
>>assigned to a 32-bit variable.  This makes be think that using lrint()
>>should work equally well, and lrint() is more widely available than
>>llrint().  Is there some subtle issue I'm missing here, or is the
>>attached patch safe?
>>  
>>
>
> This is the commit message that added this code:
>
> http://thread.gmane.org/gmane.comp.video.ffmpeg.cvs/4408/focus=4408
>
> Some systems didn't like lrint() either, so I suggest to go by the
> integer rounding route that Michael suggested later in the thread.

That still doesn't explain why llrint() is used, even though the
return value is immediately converted to 32 bits.  Michael's second
suggestion also involves unexplained 64-bit types.

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




More information about the ffmpeg-devel mailing list