diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-01-23 10:23:47 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-01-23 10:23:47 +0000 |
commit | ddb901b74d7a71b6d4968f7490d1932821b5f703 (patch) | |
tree | fdf6efce0fecdb92cd405c4b217d79559289309c /libavformat/avio.h | |
parent | 98287358e941a2173e05f7efd3630693b997459b (diff) | |
download | ffmpeg-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.h')
-rw-r--r-- | libavformat/avio.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h index 5aa24ca0a7..39c1ce5178 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -69,6 +69,14 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up, const char *filename, int flags); int url_open(URLContext **h, const char *filename, int flags); int url_read(URLContext *h, unsigned char *buf, int size); +/** + * Read as many bytes as possible (up to size), calling the + * read function multiple times if necessary. + * Will also retry if the read function returns AVERROR(EAGAIN). + * This makes special short-read handling in applications + * unnecessary, if the return value is < size then it is + * certain there was either an error or the end of file was reached. + */ int url_read_complete(URLContext *h, unsigned char *buf, int size); int url_write(URLContext *h, unsigned char *buf, int size); int64_t url_seek(URLContext *h, int64_t pos, int whence); |