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

Martin Storsjö martin
Wed Jun 2 09:11:25 CEST 2010


On Tue, 1 Jun 2010, Baptiste Coudurier wrote:

> 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.

Thanks, applied.

// Martin



More information about the ffmpeg-devel mailing list