avoid code duplication
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Jan 2007 20:11:23 +0000 (20:11 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Jan 2007 20:11:23 +0000 (20:11 +0000)
Originally committed as revision 7573 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavutil/fifo.c

index 276eeb7463484f800ce2aaee71fd060b165792ba..635df2dbf896247586d7579ef1830697d79e927f 100644 (file)
@@ -99,9 +99,7 @@ int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void
             memcpy(dest, f->rptr, len);
             dest = (uint8_t*)dest + len;
         }
-        f->rptr += len;
-        if (f->rptr >= f->end)
-            f->rptr = f->buffer;
+        av_fifo_drain(f, len);
         buf_size -= len;
     }
     return 0;