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

Michael Niedermayer michaelni
Sun Sep 17 13:11:05 CEST 2006


Hi

On Sun, Sep 17, 2006 at 12:28:53PM +0200, Panagiotis Issaris wrote:
> Hi,
> 
> On zo, 2006-09-17 at 12:23 +0200, Panagiotis Issaris wrote:
> > On zo, 2006-09-17 at 11:35 +0200, Panagiotis Issaris wrote:
> > > I had already written the attached patch before your si_prefixes commit.
> > > I'll read the related code and see how it fits in with this.
> > The attached patch tries to integrate my patch with your commit 6284. In
> > fact, I am ripping most of your code and putting it in the av_strtod()
> > function, reusing it for your eval.c code. Regression tests succeed.
> > 
> > "./ffmpeg -i src.avi -b 1000hi dst.avi" now also works :) 
> > (nicely shows 101kb/s)
> > 
> >  eval.c |   36 --------------------------------
> >  opt.c  |   71 ++++++++++++++++++++++++++++++++++++++++++++++++-----------------
> >  2 files changed, 54 insertions(+), 53 deletions(-)
> 
> Same as previous patch, adapted for commit 6286.
> 
> With friendly regards,
> Takis
> 

[...]
> -static double av_strtod(const char *name, char **tail) {
> +double av_strtod(const char *name, char **tail) {
>      double d;
[...]
> +    int p = 0;
> +    char *next;
> +    d = strtod(name, &next);
> +    /* if parsing failed, return immediately filling in tail if needed */
> +    if (next==name) {
> +        if (tail)
> +            *tail = next;
> +        return d;
>      }
[...]
> +    /* if requested, fill in tail with the position after the last parsed
> +       character */
> +    if (tail)
> +        *tail = next;
>      return d;

why not put the whole under if(next != name){ ... }
instead of the if(next == name) special case?

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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list