aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avio.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-23 10:23:47 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-23 10:23:47 +0000
commitddb901b74d7a71b6d4968f7490d1932821b5f703 (patch)
treefdf6efce0fecdb92cd405c4b217d79559289309c /libavformat/avio.c
parent98287358e941a2173e05f7efd3630693b997459b (diff)
downloadffmpeg-ddb901b74d7a71b6d4968f7490d1932821b5f703.tar.gz
Make url_read_complete retry on EAGAIN and return how much data it read
if it reached EOF, making it useful in more cases. Originally committed as revision 21393 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r--libavformat/avio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index e91bc200db..706ba4a610 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -156,8 +156,10 @@ int url_read_complete(URLContext *h, unsigned char *buf, int size)
len = 0;
while (len < size) {
ret = url_read(h, buf+len, size-len);
- if (ret < 1)
- return ret;
+ if (ret == AVERROR(EAGAIN)) {
+ ret = 0;
+ } else if (ret < 1)
+ return ret < 0 ? ret : len;
len += ret;
}
return len;