mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-25 22:19:17 +00:00
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
This commit is contained in:
parent
98287358e9
commit
ddb901b74d
2 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue