[FFmpeg-devel] [PATCH] Add writing of vorbis comments to flac files

Reimar Döffinger Reimar.Doeffinger
Sun Feb 14 09:10:35 CET 2010


On Sat, Feb 13, 2010 at 08:13:45PM -0500, Justin Ruggles wrote:
> > +int flac_write_block_comment(ByteIOContext *pb, AVMetadata *m,
> > +                             int last_block, int bitexact)
> > +{
> > +    const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
> > +    unsigned int len;
> > +    uint8_t *p, *p0;
> > +
> > +    len = ff_vorbiscomment_length(m, vendor);
> > +    p0 = av_malloc(len+4);
> > +    if (!p0)
> > +        return AVERROR(ENOMEM);
> > +    p = p0;
> > +
> > +    bytestream_put_byte(&p, last_block ? 0x84 : 0x04);
> > +    bytestream_put_be24(&p, len);
> > +    ff_vorbiscomment_write(&p, m, vendor);
> 
> 
> If the bitexact flag is set, you should pass NULL instead of m so that
> tags are not written.

I disagree, with bitexact no version-specific flags or similar should be created,
but tags in general should be created, otherwise we can never regression-test
that code.



More information about the ffmpeg-devel mailing list