vorbiscomment: simplify API by using av_dict_count()

This commit is contained in:
Anton Khirnov
2014-05-26 13:30:10 +02:00
parent 23f741f793
commit efcde917af
4 changed files with 10 additions and 16 deletions

View File

@@ -273,18 +273,17 @@ static uint8_t *ogg_write_vorbiscomment(int offset, int bitexact,
const char *vendor = bitexact ? "Libav" : LIBAVFORMAT_IDENT;
int size;
uint8_t *p, *p0;
unsigned int count;
ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL);
size = offset + ff_vorbiscomment_length(*m, vendor, &count) + framing_bit;
size = offset + ff_vorbiscomment_length(*m, vendor) + framing_bit;
p = av_mallocz(size);
if (!p)
return NULL;
p0 = p;
p += offset;
ff_vorbiscomment_write(&p, m, vendor, count);
ff_vorbiscomment_write(&p, m, vendor);
if (framing_bit)
bytestream_put_byte(&p, 1);