summaryrefslogtreecommitdiff
path: root/libavformat/avio_internal.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-06 20:08:30 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-03-07 12:25:36 -0500
commitf1ef2cd9ed22be231bb4da8d2f93d9a0c7877aa7 (patch)
treefd9ec78eaa106f3f8172a1bc36e459d102ad99a7 /libavformat/avio_internal.h
parente8bb2e24398ec838d9e49cf115b7e132609a9fb7 (diff)
avio: move ff_rewind_with_probe_data from avio.h to avio_internal.h
also change its prefix to ffio Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/avio_internal.h')
-rw-r--r--libavformat/avio_internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 279c7f60ff..3abb619b8a 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -47,4 +47,18 @@ static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
avio_wl32(pb, MKTAG(s[0], s[1], s[2], s[3]));
}
+/**
+ * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
+ * Used after probing to avoid seeking.
+ * Joins buf and s->buffer, taking any overlap into consideration.
+ * @note s->buffer must overlap with buf or they can't be joined and the function fails
+ *
+ * @param s The read-only AVIOContext to rewind
+ * @param buf The probe buffer containing the first buf_size bytes of the file
+ * @param buf_size The size of buf
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
+
#endif // AVFORMAT_AVIO_INTERNAL_H