[FFmpeg-devel] [PATCH] rdt.c: ASM rulebook bitrate reading

Michael Niedermayer michaelni
Fri Jan 2 16:10:23 CET 2009


On Fri, Jan 02, 2009 at 09:28:32AM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Dec 29, 2008 at 11:03 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Mon, Dec 29, 2008 at 11:01:43AM -0500, Ronald S. Bultje wrote:
> >> On Mon, Dec 29, 2008 at 7:58 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > On Sun, Dec 28, 2008 at 06:32:22PM -0500, Ronald S. Bultje wrote:
> >> >> +        while (*p == ' ' && p < end) p++;
> >> >> +        if (!(e_end = strchr(p, ',')) || e_end > end)
> >> >> +            e_end = end;
> >> >> +        if (!(first && *p == '#')) {
> >> >> +            if (!strncasecmp(p, "averagebandwidth=", 17))
> >> >> +                st->codec->bit_rate = atoi(p+17);
> >> >> +        }
> >> >> +        p = e_end + 1;
> >> >> +        first = 0;
> >> >
> >> > sscanf(" averagebandwidth=%d", &st->codec->bit_rate);
> >>
> >> Is there case-insensitive sscanf()?
> >
> > there is %*1[Aa]%*1[Vv]%*1[Ee]...
> > or you can convert your source to lowwer case first
> 
> I decided to go for a simpler version of the first (which accepts the
> two cases that I've seen so far: AverageBandwidth and
> averagebandwidth). The lowercasing needs a copy of the string (because
> it's a const char) and for a case as simple as this, I thought that
> was kind of silly waste of pretty simple little code.
> 
> New patch attached.

looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090102/a91a1f24/attachment.pgp>



More information about the ffmpeg-devel mailing list