diff avio.h @ 5941:bde9a4b67f86 libavformat

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.
author thardin
date Thu, 08 Apr 2010 09:02:27 +0000
parents b8041f85c327
children 178de7695c6c
line wrap: on
line diff
--- a/avio.h	Wed Apr 07 19:40:46 2010 +0000
+++ b/avio.h	Thu Apr 08 09:02:27 2010 +0000
@@ -433,6 +433,21 @@
 #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