[FFmpeg-devel] [PATCH] rdt.c: ASM rulebook bitrate reading
Ronald S. Bultje
rsbultje
Fri Jan 2 15:28:32 CET 2009
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.
Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rdt-parse-stream-bitrate.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090102/ef80d784/attachment.txt>
More information about the ffmpeg-devel
mailing list