[FFmpeg-devel] [PATCH] Set frame rate on v4l2 devices

José Miguel Gonçalves jose.goncalves
Mon Sep 13 15:18:10 CEST 2010


On 09/13/2010 01:24 PM, M?ns Rullg?rd wrote:
> jose.goncalves at inov.pt writes:
>
>    
>> I assumed that when using the options "-std=c99 -Wextra" gcc would
>> only give me warnings for not complying with the C standard. It seems
>> I'm wrong. Nevertheless, I quickly take a look to the C99 standard,
>> section 6.7.8, and that is not so clear to me.
>>      
> Which part of the following paragraph do you find unclear?
>
>    If there are fewer initializers in a brace-enclosed list than there
>    are elements or members of an aggregate, or fewer characters in a
>    string literal used to initialize an array of known size than there
>    are elements in the array, the remainder of the aggregate shall be
>    initialized implicitly the same as objects that have static storage
>    duration.
>
>    

I told you that was a quick look... that paragraph (21) together with 
paragraph 10 makes it now clear to me.

>> Hum... I tend to disagree. The definition also says that OK is 0 or a
>> positive value. So it's better to assume that values not explicitly
>> indicated (all negative, except -1) are an error. But, this is a minor
>> thing, the important is to add the missing functionality to
>> ffmpeg... here goes the corrected patch.
>>      
> Actually, in this particular case, the ioctl() return value is
> expected to be zero, so treating any non-zero value as an error is
> probably the best course of action.  In general, the meaning of the
> return value is defined by specific request.  The only value reserved
> as an error code is -1, all others can be valid return values from the
> requested operation.
>    

I agree with you. For this specific ioctl it would be better to treat 
non-zero as an error.

Bottom line. I think it's always better to consider an error everything 
else that is not considered OK.

Regards,
Jos? Gon?alves



More information about the ffmpeg-devel mailing list