diff options
author | Anton Khirnov <wyskas@gmail.com> | 2010-10-27 09:02:29 +0400 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2010-10-27 09:02:29 +0400 |
commit | 042ca05f0fdc5f4d56a3e9b94bc9cd67bca9a4bc (patch) | |
tree | 4ffb69760275cb8439ffad13c75c147265c7be7b | |
parent | 47bfe49c649b0ad8fc654de9acfc70971c43a911 (diff) |
vorbiscomment: convert metadata before computing the header's length
Originally committed as revision 25586 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/flacenc.c | 2 | ||||
-rw-r--r-- | libavformat/oggenc.c | 2 | ||||
-rw-r--r-- | libavformat/vorbiscomment.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index 996d9f43e0..281d013430 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -46,6 +46,8 @@ static int flac_write_block_comment(ByteIOContext *pb, AVMetadata **m, unsigned int len, count; uint8_t *p, *p0; + ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL); + len = ff_vorbiscomment_length(*m, vendor, &count); p0 = av_malloc(len+4); if (!p0) diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 7ec1b3ee05..8f6ba69307 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -213,6 +213,8 @@ static uint8_t *ogg_write_vorbiscomment(int offset, int bitexact, 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; p = av_mallocz(size); if (!p) diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index d141b9dede..59a403f209 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -55,7 +55,6 @@ int ff_vorbiscomment_length(AVMetadata *m, const char *vendor_string, int ff_vorbiscomment_write(uint8_t **p, AVMetadata **m, const char *vendor_string, const unsigned count) { - ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL); bytestream_put_le32(p, strlen(vendor_string)); bytestream_put_buffer(p, vendor_string, strlen(vendor_string)); if (*m) { |