From 5d76674756806e3b458e484788775fcee34aac2a Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 Aug 2017 15:01:44 +0200 Subject: lavf: make avio_read_partial() public Main use-case is proxying avio through a foreign I/O layer and a custom AVIO context, without losing latency and performance characteristics. Signed-off-by: Luca Barbato Merged from Libav commit 173b56218f39c64. --- libavformat/avio.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libavformat/avio.h') diff --git a/libavformat/avio.h b/libavformat/avio.h index 89ad5c04ea..f9c5972ada 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -598,6 +598,15 @@ void avio_flush(AVIOContext *s); */ int avio_read(AVIOContext *s, unsigned char *buf, int size); +/** + * Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed + * to read fewer bytes than requested. The missing bytes can be read in the next + * call. This always tries to read at least 1 byte. + * Useful to reduce latency in certain cases. + * @return number of bytes read or AVERROR + */ +int avio_read_partial(AVIOContext *s, unsigned char *buf, int size); + /** * @name Functions for reading from AVIOContext * @{ -- cgit v1.2.3