Browse Source

vorbiscomment: convert metadata before computing the header's length

Originally committed as revision 25586 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Anton Khirnov 14 years ago
parent
commit
042ca05f0f
3 changed files with 4 additions and 1 deletions
  1. +2
    -0
      libavformat/flacenc.c
  2. +2
    -0
      libavformat/oggenc.c
  3. +0
    -1
      libavformat/vorbiscomment.c

+ 2
- 0
libavformat/flacenc.c View File

@@ -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)


+ 2
- 0
libavformat/oggenc.c View File

@@ -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)


+ 0
- 1
libavformat/vorbiscomment.c View File

@@ -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) {


Loading…
Cancel
Save