From 639728f51a9fa5e321effad5909c1e37df0e80bb Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 26 Nov 2019 07:53:52 +0100 Subject: avformat/aviobuf: Add function to reset dynamic buffer Resetting a dynamic buffer means to keep the AVIOContext and the internal buffer used by the dynamic buffer. This is done in order to save (re)allocations when one has a workflow where one opens and closes dynamic buffers in sequence. Signed-off-by: Andreas Rheinhardt --- libavformat/avio_internal.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavformat/avio_internal.h') diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index eb628ac493..c575df8035 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -171,6 +171,13 @@ int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, */ 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. * -- cgit v1.2.3