Browse Source

simplify

Originally committed as revision 7568 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 18 years ago
parent
commit
f81b99b82b
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      libavutil/fifo.c

+ 2
- 5
libavutil/fifo.c View File

@@ -50,15 +50,12 @@ int av_fifo_size(AVFifoBuffer *f)
*/
int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
{
int len;
int size = f->wptr - f->rptr;
if (size < 0)
size += f->end - f->buffer;
int size = av_fifo_size(f);

if (size < buf_size)
return -1;
while (buf_size > 0) {
len = FFMIN(f->end - f->rptr, buf_size);
int len = FFMIN(f->end - f->rptr, buf_size);
memcpy(buf, f->rptr, len);
buf += len;
f->rptr += len;


Loading…
Cancel
Save