[Ffmpeg-cvslog] r7568 - trunk/libavutil/fifo.c

michael subversion
Wed Jan 17 20:19:03 CET 2007


Author: michael
Date: Wed Jan 17 20:19:03 2007
New Revision: 7568

Modified:
   trunk/libavutil/fifo.c

Log:
simplify


Modified: trunk/libavutil/fifo.c
==============================================================================
--- trunk/libavutil/fifo.c	(original)
+++ trunk/libavutil/fifo.c	Wed Jan 17 20:19:03 2007
@@ -50,15 +50,12 @@
  */
 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;




More information about the ffmpeg-cvslog mailing list