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

Stefano Sabatini stefano.sabatini-lala
Mon Feb 25 09:27:54 CET 2008


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.

Regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: implement-args-parsing-in-parse-options-01.patch
Type: text/x-diff
Size: 1146 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080225/af058f6b/attachment.patch>



More information about the ffmpeg-devel mailing list