diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-24 13:23:30 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-24 23:07:41 +0200 |
commit | 8a273a746061a112e5e35066a8fd8e146d821a62 (patch) | |
tree | c8751366ea7ae24a4e6ec2bc44fd2984458eeb9f /libavformat/aviobuf.c | |
parent | 078d43e23a7a3d64aafee8a58b380d3e139b3020 (diff) | |
download | ffmpeg-8a273a746061a112e5e35066a8fd8e146d821a62.tar.gz |
avio: Add an internal utility function for freeing dynamic buffers
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 5f848b20f9..8dc805a3ae 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -991,6 +991,16 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) return size - padding; } +void ffio_free_dyn_buf(AVIOContext **s) +{ + uint8_t *tmp; + if (!*s) + return; + avio_close_dyn_buf(*s, &tmp); + av_free(tmp); + *s = NULL; +} + static int null_buf_write(void *opaque, uint8_t *buf, int buf_size) { DynBuffer *d = opaque; |