summaryrefslogtreecommitdiff
path: root/libavformat/metadata.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-01-06 22:11:04 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-01-06 22:11:04 +0000
commit094d9df72e8372b0a7c6e9381b375b438db3fa3c (patch)
treebc1ecfa16f0b5b5dd14c9a9910f343d4a11b22e5 /libavformat/metadata.c
parent16cda1535edf853c31506b2c737d0a6873744550 (diff)
downloadffmpeg-094d9df72e8372b0a7c6e9381b375b438db3fa3c.tar.gz
free all allocated metadata structures
Originally committed as revision 16457 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/metadata.c')
-rw-r--r--libavformat/metadata.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/metadata.c b/libavformat/metadata.c
index 5c7ef06199..70bfa3d35b 100644
--- a/libavformat/metadata.c
+++ b/libavformat/metadata.c
@@ -74,6 +74,20 @@ int av_metadata_set(AVMetadata **pm, AVMetadataTag elem)
return 0;
}
+void av_metadata_free(AVMetadata **pm)
+{
+ AVMetadata *m= *pm;
+
+ if(m){
+ while(m->count--){
+ av_free(m->elems[m->count].key);
+ av_free(m->elems[m->count].value);
+ }
+ av_free(m->elems);
+ }
+ av_freep(pm);
+}
+
#if LIBAVFORMAT_VERSION_MAJOR < 53
#define FILL_METADATA(s, key, value) { \
if (value && *value && \