aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2010-04-08 09:02:27 +0000
committerTomas Härdin <tomas.hardin@codemill.se>2010-04-08 09:02:27 +0000
commit01d91b9be978753803fa6f5e73b17ab9f03a5c7b (patch)
tree35a484f2b8a8da202fdf2c815f41f8f9d14053d7 /libavformat/avio.h
parentba659bedb806cb4a1dd375f723a2b0017d6afb33 (diff)
downloadffmpeg-01d91b9be978753803fa6f5e73b17ab9f03a5c7b.tar.gz
Reusing the probe buffer to rewind the ByteIOContext in ff_probe_input_buffer() instead of seeking back to the start of the file. Once exhausted, the size of the buffer is reduced.
Originally committed as revision 22821 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 649de15ea9..d186876051 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -433,6 +433,21 @@ int url_resetbuf(ByteIOContext *s, int flags);
#endif
/**
+ * Rewinds the ByteIOContext 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
+ * @note This function is NOT part of the public API
+ *
+ * @param s The read-only ByteIOContext 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 ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
+
+/**
* Creates and initializes a ByteIOContext for accessing the
* resource indicated by url.
* @note When the resource indicated by url has been opened in