diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-01-17 19:19:03 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-01-17 19:19:03 +0000 |
commit | f81b99b82b807e6a7716cf47e4d1748b32ca4b39 (patch) | |
tree | 2c1a440016855905c4b86edb309526b3402d34e2 | |
parent | 80036204af792fd31a82b42f345571c4ed699470 (diff) | |
download | ffmpeg-f81b99b82b807e6a7716cf47e4d1748b32ca4b39.tar.gz |
simplify
Originally committed as revision 7568 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavutil/fifo.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 550f13de58..6a73b3f0d6 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -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; |