[FFmpeg-cvslog] avio: Handle AVERROR_EOF in the same way as the return value 0

Michael Niedermayer git at videolan.org
Sat Sep 14 11:06:09 CEST 2013


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Mon Jun 24 14:23:44 2013 +0200| [42ad4178fd2dfa38a9a713419641c2ff41a85e98] | committer: Luca Barbato

avio: Handle AVERROR_EOF in the same way as the return value 0

This makes sure the ffurl_read_complete function actually
returns the number of bytes read, as the documentation of the
function says, even if the underlying protocol uses AVERROR_EOF
instead of 0.

Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 5d876be87a115b93dd2e644049e3ada2cfb5ccb7)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42ad4178fd2dfa38a9a713419641c2ff41a85e98
---

 libavformat/avio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index ee4dfb6..cfefa60 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -328,7 +328,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
             else
                 usleep(1000);
         } else if (ret < 1)
-            return ret < 0 ? ret : len;
+            return (ret < 0 && ret != AVERROR_EOF) ? ret : len;
         if (ret)
            fast_retries = FFMAX(fast_retries, 2);
         len += ret;



More information about the ffmpeg-cvslog mailing list