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

Benoit Fouet benoit.fouet
Mon Feb 25 15:16:07 CET 2008


Michael Niedermayer wrote:
> 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
>
>   

applied

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list