On Thu, Jun 30, 2011 at 10:11:04AM +0200, Stefano Sabatini wrote: > The new functions provides a more generic interface than
s/functions/function/ > av_fifo_peek2() for peeking data out of a fifo buffer. s/fifo/FIFO/ > --- a/libavutil/fifo.h > +++ b/libavutil/fifo.h > @@ -113,4 +113,17 @@ static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int > offs) > + > +/** > + * Return a pointer to the data offset by offs stored in the fifo, > + * without modifying the fifo itself. > + */ FIFO Neither the parameters, nor the return value have (Doxygen) documentation. But there is interesting stuff that you could document there, namely that a NULL pointer will make this function crash. > +static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) const AVFifoBuffer * const f, const int offs would be even more const-correct. > + uint8_t *ptr = f->rptr + offs; > + if (ptr >= f->end) > + ptr -= f->end - f->buffer; > + return ptr; To me this looks like you can still end up outside the FIFO if the offset is larger than two times the FIFO size. Diego _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
