summaryrefslogtreecommitdiff
path: root/libavformat/avio_internal.h
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-05-26 14:24:38 +0100
committerLuca Barbato <lu_zero@gentoo.org>2015-05-31 13:05:13 +0200
commitbff0349d9da527084e1433167466d8afc9e25c7f (patch)
tree444ab4773f9fcca36c6f6403aa7f757dabed75bd /libavformat/avio_internal.h
parentcffb9ea81bd16d2ed8bce187b6bf0279c07b3b9b (diff)
avio: Add avio_read wrapper to simplify error checking
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/avio_internal.h')
-rw-r--r--libavformat/avio_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index c8630ab66e..aff5564215 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -85,6 +85,13 @@ int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size
uint64_t ffio_read_varlen(AVIOContext *bc);
+/**
+ * Read size bytes from AVIOContext into buf.
+ * Check that exactly size bytes have been read.
+ * @return number of bytes read or AVERROR
+ */
+int ffio_read_size(AVIOContext *s, unsigned char *buf, int size);
+
/** @warning must be called before any I/O */
int ffio_set_buf_size(AVIOContext *s, int buf_size);