diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-02 21:45:55 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-02 21:45:55 +0000 |
commit | 5ea7ce884303ee95f7c47e658951cf5e19e24df6 (patch) | |
tree | cc250922dfd50959179dadd22c8b088cf1be5b38 /libavformat/metadata.c | |
parent | 69b6d53bebbdb25f424b87123eef60de24693cf2 (diff) | |
download | ffmpeg-5ea7ce884303ee95f7c47e658951cf5e19e24df6.tar.gz |
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.
Originally committed as revision 16952 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/metadata.c')
-rw-r--r-- | libavformat/metadata.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/metadata.c b/libavformat/metadata.c index eb545fddb4..6744f22db7 100644 --- a/libavformat/metadata.c +++ b/libavformat/metadata.c @@ -44,10 +44,10 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f 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 @@ int av_metadata_set(AVMetadata **pm, AVMetadataTag elem) }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); |