[vlc-devel] dc1394 module update

Rémi Denis-Courmont remi at remlab.net
Fri Oct 16 08:49:06 CEST 2009


On Fri, 16 Oct 2009 08:31:58 +0200, Jean-Baptiste Kempf <jb at videolan.org>
wrote:
>> diff --git a/vlc-1.0.1/modules/access/dc1394.c b/dc1394.c
>> index 9fa05aa..3ff06af 100644
>> --- a/vlc-1.0.1/modules/access/dc1394.c
>> +++ b/dc1394.c
> 
>> +        for( i=0; i < (int)sys->num_cameras; i++ )
> 
> You can (and probably should) use:
> for( int i = 0; i < (int)sys->num_cameras; i++ )

Actually, I do not see why we'd need the signed cast in the first place:
for(unsigned i = 0; i < sys->num_cameras; i++)

>> +    {
>> +        msg_Err( p_demux, "not enough memory available");
>>          return VLC_ENOMEM;
>> +    }
> I think that throwing a msg_Err when ENOMEM is wrong and useless...

Yes, msg_Err needs to allocate memory, so it's not very helpful.

>> +        msg_Err( p_demux, "unable to print camera info");
> "Unable" maybe.
> 
>> +        msg_Err( p_demux, "unable to set framerate");
> ditto
> 
>> +        msg_Err( p_demux, "unable to set video mode");
> And again.

Most of our error messages start with a lower case AFAIK.

>> +            msg_Err( p_demux ,"%d", res );
>> +            msg_Err( p_demux ,"unable to setup capture" );
>> +            msg_Err( p_demux, "make sure that the supplied video mode,
> framerate,");
>> +            msg_Err( p_demux, "and format are supported by your
> camera");
> Do we need all that debug?

Indeed definitely not at 'Err' level.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list