[vlc-devel] [PATCH] Seek functionality for modules/access/imem.c

Laurent Aimar fenrir at elivagar.org
Mon May 3 22:19:45 CEST 2010


On Mon, 2010-05-03 at 10:50 -0600, Daniel O'Neill wrote:
> Hi fenrir, remi, et al.
> 
> > > -        *b = false;
> > > +        *b = (sys->source.seek != NULL);
> >  Useless ()
> 
> The idea here was to state seeking exists only if the seek callback is registered, so sequential-only access to the imem interface will properly declare their non-seekability to other VLC modules.
> 
> If that much is obvious, I put braces around the condition because.. well, it's a condition :)
 Ok, if you prefer it.


> > > -    unsigned flags;
> > > -    size_t buffer_size;
> > > -    void   *buffer;
> > > +    unsigned flags = 0;
> > > +    size_t   buffer_size = 0;
> > > +    void    *buffer = NULL;
> >  Useless initializations:
> >  - flags is unused and otherwise should be set by the get callback.
> >  - buffer_size and buffer are set by the get callback.
> 
> The reason I initialise them is in case the callback doesn't set these values but returns a true status.
 Well, in this case, the callback is buggy and should be fixed instead.
I dislike workarounding bugs as they tend to make codes harder to
maintain in the long term .

-- 
fenrir




More information about the vlc-devel mailing list