You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-14 22:15:12 +02: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:
@ -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;
|
||||
|
Reference in New Issue
Block a user