aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/vorbiscomment.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-28 13:08:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-28 13:08:50 +0200
commitdff4aa6afd40bcc6c71b5a21d229fb941f9fc1eb (patch)
treee50cc5c08974c011ff14516a14d602605eee065a /libavformat/vorbiscomment.c
parent579e2b2874aeaa9cfdeed1fd1408767e33a63029 (diff)
parentefcde917af407a6031ecff68edd51fce7b83d104 (diff)
downloadffmpeg-dff4aa6afd40bcc6c71b5a21d229fb941f9fc1eb.tar.gz
Merge commit 'efcde917af407a6031ecff68edd51fce7b83d104'
* commit 'efcde917af407a6031ecff68edd51fce7b83d104': vorbiscomment: simplify API by using av_dict_count() Conflicts: libavformat/flacenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/vorbiscomment.c')
-rw-r--r--libavformat/vorbiscomment.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c
index f17a0c1d13..cc9b6620ef 100644
--- a/libavformat/vorbiscomment.c
+++ b/libavformat/vorbiscomment.c
@@ -38,28 +38,26 @@ const AVMetadataConv ff_vorbiscomment_metadata_conv[] = {
{ 0 }
};
-int ff_vorbiscomment_length(AVDictionary *m, const char *vendor_string,
- unsigned *count)
+int ff_vorbiscomment_length(AVDictionary *m, const char *vendor_string)
{
int len = 8;
len += strlen(vendor_string);
- *count = 0;
if (m) {
AVDictionaryEntry *tag = NULL;
while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
len += 4 +strlen(tag->key) + 1 + strlen(tag->value);
- (*count)++;
}
}
return len;
}
int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m,
- const char *vendor_string, const unsigned count)
+ const char *vendor_string)
{
bytestream_put_le32(p, strlen(vendor_string));
bytestream_put_buffer(p, vendor_string, strlen(vendor_string));
if (*m) {
+ int count = av_dict_count(*m);
AVDictionaryEntry *tag = NULL;
bytestream_put_le32(p, count);
while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {