[Ffmpeg-devel] [PATCH] Add kibi, mibi and gibi support

Panagiotis Issaris takis.issaris
Sat Sep 16 11:50:39 CEST 2006


Hi,

On za, 2006-09-16 at 11:21 +0200, Panagiotis Issaris wrote:
> On za, 2006-09-16 at 10:13 +0200, Panagiotis Issaris wrote:
> > On za, 2006-09-16 at 09:56 +0200, Panagiotis Issaris wrote:
> >[...]
> > > The attached patch adds support for the "ki", "Mi" and "Gi" postfixes to
> > > the AVOption option parsing code. I do know that this in fact is
> > > incorrect, as the official SI standard uses "Ki" instead of "ki" "for
> > > consistency reasons" [1]. 
> > > 
> > > I was wondering how to solve this? Should I just make the kilo case
> > > insensitive thus allow both 'k' and 'K' for both? Or make all of them
> > > case insensitive? What about 'B' then? I had the initial intention to
> > > have 'B' stand for "byte" and 'b' for "bit" with "" being a shorthand
> > > for 'b'. If case sensitivity would be removed, both "b" and "B" would
> > > stand for "byte" (in the current implementation).
> Regression tests succeed with this new corrected version of the same
> patch.
There was another bug in the av_strtod() function. The attached third
version of this patch fixes this.

The problem was that av_strtod() was not correctly interpreting strings
which contained no number. If the first call to strtod() indicated that
there was no number, it should have returned immediately. But it didn't
which caused it to interpret the first 'i' of "-dct int" as some kind of
number. This was also due to the previous bug, which allowed using "i"
without an earlier "k", "M" or "G" which makes no sense at all. Only
fixing this behavior would ofcourse be wrong, as any other flag value,
starting with a B would cause yet another option interpretation problem.

 opt.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

As this is already the _third_ version of this patch, I will do another
thorough review of the related code, but I'm sending it to the ml
anyways in case anyone sees other bugs.

Regression tests succeed.

With friendly regards,
Takis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20060916T113902-ffmpeg-binary_powers-v3.diff
Type: text/x-patch
Size: 1350 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060916/66d1daba/attachment.bin>



More information about the ffmpeg-devel mailing list