[FFmpeg-devel] [PATCH] Make parse_options use parse_number_or_die for parsing args

Michael Niedermayer michaelni
Mon Feb 25 14:01:04 CET 2008


On Mon, Feb 25, 2008 at 09:27:54AM +0100, Stefano Sabatini wrote:
> On date Monday 2008-02-25 03:48:41 +0100, Michael Niedermayer encoded:
> > On Mon, Feb 25, 2008 at 12:39:09AM +0100, Stefano Sabatini wrote:
> > > Hi, as in $subject.
> > > 
> > > BTW, I still somehow don't like the parse_number_or_die function since it can't
> > > for example checks for errors like these:
> > > ffmpeg -dframes 123.456
> > > 
> > > 123.456 is converted to 123, no warning issued.
> > 
> > Thats because your code is buggy.
> > [...]
> > > -                *po->u.int_arg = atoi(arg);
> > > +                *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT, INT_MIN, INT_MAX);
> 
> Ugh, you're right.
> ./ffmpeg -dframes 123.456
> [...]
> Expected int64 for dframes but found 123.456
> 
> > use OPT_INT64 here
> 
> Fixed.

ok

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/20080225/5971ec72/attachment.pgp>



More information about the ffmpeg-devel mailing list