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

Ronald S. Bultje rsbultje
Sun May 30 20:54:45 CEST 2010


Hi,

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.

Ronald



More information about the ffmpeg-devel mailing list