[FFmpeg-devel] [PATCH] lavu/parseutils: reduce fraction in av_parse_ratio()

Stefano Sabatini stefasab at gmail.com
Wed Oct 17 11:33:35 CEST 2012


On date Wednesday 2012-10-17 00:19:59 +0200, Michael Niedermayer encoded:
> On Tue, Oct 16, 2012 at 09:45:03PM +0200, Stefano Sabatini wrote:
> > Consistent with the a/b case, and with the documentation.
> > 
> > TODO: bump micro
> > ---
> >  libavutil/parseutils.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> > index 84bb9f7..134c07f 100644
> > --- a/libavutil/parseutils.c
> > +++ b/libavutil/parseutils.c
> > @@ -57,6 +57,8 @@ int av_parse_ratio(AVRational *q, const char *str, int max,
> >          if (ret < 0)
> >              return ret;
> >          *q = av_d2q(d, max);
> > +    } else {
> > +        av_reduce(&q->num, &q->den, q->num, q->den, max);
> >      }
> >  
> >      gcd = av_gcd(FFABS(q->num), FFABS(q->den));
> 
> the gcd code is redundnat if reduce is run

Updated.
-- 
FFmpeg = Faithless & Fabulous Mind-dumbing Practical Erudite Geisha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-parseutils-rework-rational-reduction-logic-in-a.patch
Type: text/x-diff
Size: 1160 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121017/0290fffc/attachment.bin>


More information about the ffmpeg-devel mailing list