/** @warning must be called before any I/O */
int ffio_set_buf_size(AVIOContext *s, int buf_size);
+/**
+ * Reallocate a given buffer for AVIOContext.
+ *
+ * @param s the AVIOContext to realloc.
+ * @param buf_size required new buffer size.
+ * @return 0 on success, a negative AVERROR on failure.
+ */
+int ffio_realloc_buf(AVIOContext *s, int buf_size);
+
/**
* Ensures that the requested seekback buffer size will be available
*
* Will ensure that when reading sequentially up to buf_size, seeking
* within the current pos and pos+buf_size is possible.
- * Once the stream position moves outside this window this guarantee is lost.
+ * Once the stream position moves outside this window or another
+ * ffio_ensure_seekback call requests a buffer outside this window this
+ * guarantee is lost.
*/
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size);
*/
int ffio_close_null_buf(AVIOContext *s);
+/**
+ * Reset a dynamic buffer.
+ *
+ * Resets everything, but keeps the allocated buffer for later use.
+ */
+void ffio_reset_dyn_buf(AVIOContext *s);
+
/**
* Free a dynamic buffer.
*