Mercurial > libavformat.hg
diff metadata.c @ 4353:e4a1b568b313 libavformat
modify the way to pass parameters to av_metadata_set()
This improves code readability and this avoid warnings about discarding
qualifiers from pointer target type.
author | aurel |
---|---|
date | Mon, 02 Feb 2009 21:45:55 +0000 |
parents | 2fc899894f5e |
children | e62a61d3e591 |
line wrap: on
line diff
--- a/metadata.c Mon Feb 02 21:32:11 2009 +0000 +++ b/metadata.c Mon Feb 02 21:45:55 2009 +0000 @@ -44,10 +44,10 @@ return NULL; } -int av_metadata_set(AVMetadata **pm, AVMetadataTag elem) +int av_metadata_set(AVMetadata **pm, const char *key, const char *value) { AVMetadata *m= *pm; - AVMetadataTag *tag= av_metadata_get(m, elem.key, NULL, AV_METADATA_MATCH_CASE); + AVMetadataTag *tag= av_metadata_get(m, key, NULL, AV_METADATA_MATCH_CASE); if(!m) m=*pm= av_mallocz(sizeof(*m)); @@ -63,10 +63,10 @@ }else return AVERROR(ENOMEM); } - if(elem.value){ - elem.key = av_strdup(elem.key ); - elem.value= av_strdup(elem.value); - m->elems[m->count++]= elem; + if(value){ + m->elems[m->count].key = av_strdup(key ); + m->elems[m->count].value= av_strdup(value); + m->count++; } if(!m->count) av_freep(pm);