[vlc-devel] [PATCH] Seek functionality for modules/access/imem.c
Daniel O'Neill
ver at foxmoxie.net
Mon May 3 18:50:42 CEST 2010
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 :) Also, that's how modules/access/file.c (line 367) does it:
*pb_bool = (p_access->pf_seek != NoSeek);
> > - 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.
It's not really a big deal, that's just how I would have had it in the interests of safety.
More information about the vlc-devel
mailing list