Revision 0871ae1a libavutil/fifo.c

View differences:

libavutil/fifo.c
45 45
    return size;
46 46
}
47 47

  
48
/**
49
 * Get data from the fifo (returns -1 if not enough data).
50
 */
51 48
int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
52 49
{
53 50
    return av_fifo_generic_read(f, buf_size, NULL, buf);
......
97 94
}
98 95

  
99 96

  
100
/** get data from the fifo (return -1 if not enough data) */
101 97
int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest)
102 98
{
103
    int size = av_fifo_size(f);
104

  
105
    if (size < buf_size)
106
        return -1;
107 99
    do {
108 100
        int len = FFMIN(f->end - f->rptr, buf_size);
109 101
        if(func) func(dest, f->rptr, len);

Also available in: Unified diff