[FFmpeg-devel] [PATCH] ffserver: Parse audio bit rates as floating point

Baptiste Coudurier baptiste.coudurier
Tue Jun 1 23:55:30 CEST 2010


On 05/30/2010 01:19 PM, Martin Storsj? wrote:
> Hi,
>
> On Sun, 30 May 2010, Ronald S. Bultje wrote:
>
>> On Sat, May 29, 2010 at 1:05 PM, Martin Storsj?<martin at martin.st>  wrote:
>>> With the attached patch, the audio bit rate configuration is read as
>>> floating point, allowing to set e.g. 12.2 kbps, which is one of the
>>> supported bitrates of the libopencore_amrnb encoder (which has no bitrates
>>> that are exact multiples of 1000).
>> [..]
>>> -                audio_enc.bit_rate = atoi(arg) * 1000;
>>> +                audio_enc.bit_rate = atof(arg) * 1000;
>>
>> You probably want to round (something like lrintf() or so) to prevent
>> obvious rounding errors inherent to floats.
>
> Ah, good idea. Updated patch attached.

Patch ok.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list