[FFmpeg-devel] [PATCH] avutil/fifo: func could return less bytes in av_fifo_generic_write()

Zhang Rui bbcallen at gmail.com
Tue Jul 14 08:47:26 CEST 2015


---
 libavutil/fifo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 4ff3194..f2fe93d 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -129,7 +129,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size,
     do {
         int len = FFMIN(f->end - wptr, size);
         if (func) {
-            if (func(src, wptr, len) <= 0)
+            len = func(src, wptr, len);
+            if (len <= 0)
                 break;
         } else {
             memcpy(wptr, src, len);
-- 
2.0.0



More information about the ffmpeg-devel mailing list