r21850 - in trunk/libavformat: avi.c avienc.c metadata.c metadata.h mp3.c utils.c
Author: rbultje Date: Tue Feb 16 17:32:25 2010 New Revision: 21850 Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers. Patch by Anton Khirnov <wyskas gmail com>. Modified: trunk/libavformat/avi.c trunk/libavformat/avienc.c trunk/libavformat/metadata.c trunk/libavformat/metadata.h trunk/libavformat/mp3.c trunk/libavformat/utils.c Modified: trunk/libavformat/avi.c ============================================================================== --- trunk/libavformat/avi.c Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/avi.c Tue Feb 16 17:32:25 2010 (r21850) @@ -40,6 +40,6 @@ const AVMetadataConv ff_avi_metadata_con const char ff_avi_tags[][5] = { "IARL", "IART", "ICMS", "ICMT", "ICOP", "ICRD", "ICRP", "IDIM", "IDPI", "IENG", "IGNR", "IKEY", "ILGT", "ILNG", "IMED", "INAM", "IPLT", "IPRD", - "IPRT", "ISBJ",/*"ISFT"*/"ISHP", "ISRC", "ISRF", "ITCH", + "IPRT", "ISBJ", "ISFT", "ISHP", "ISRC", "ISRF", "ITCH", {0} }; Modified: trunk/libavformat/avienc.c ============================================================================== --- trunk/libavformat/avienc.c Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/avienc.c Tue Feb 16 17:32:25 2010 (r21850) @@ -376,8 +376,6 @@ static int avi_write_header(AVFormatCont if ((t = av_metadata_get(s->metadata, ff_avi_tags[i], NULL, AV_METADATA_MATCH_CASE))) avi_write_info_tag(s->pb, t->key, t->value); } - if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) - avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT); ff_end_tag(pb, list2); /* some padding for easier tag editing */ Modified: trunk/libavformat/metadata.c ============================================================================== --- trunk/libavformat/metadata.c Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/metadata.c Tue Feb 16 17:32:25 2010 (r21850) @@ -105,7 +105,7 @@ void av_metadata_free(AVMetadata **pm) av_freep(pm); } -static void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, +void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv) { /* TODO: use binary search to look up the two conversion tables Modified: trunk/libavformat/metadata.h ============================================================================== --- trunk/libavformat/metadata.h Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/metadata.h Tue Feb 16 17:32:25 2010 (r21850) @@ -45,4 +45,7 @@ void ff_metadata_demux_compat(AVFormatCo void ff_metadata_mux_compat(AVFormatContext *s); #endif +void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, + const AVMetadataConv *s_conv); + #endif /* AVFORMAT_METADATA_H */ Modified: trunk/libavformat/mp3.c ============================================================================== --- trunk/libavformat/mp3.c Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/mp3.c Tue Feb 16 17:32:25 2010 (r21850) @@ -313,7 +313,7 @@ static int mp3_write_header(struct AVFor while ((t = av_metadata_get(s->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) { uint32_t tag = 0; - if (t->key[0] == 'T' && strcmp(t->key, "TSSE")) { + if (t->key[0] == 'T' && strlen(t->key) == 4) { int i; for (i = 0; *ff_id3v2_tags[i]; i++) if (AV_RB32(t->key) == AV_RB32(ff_id3v2_tags[i])) { @@ -338,11 +338,6 @@ static int mp3_write_header(struct AVFor av_free(buf); } } - if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { - totlen += strlen(LIBAVFORMAT_IDENT) + ID3v2_HEADER_SIZE + 2; - id3v2_put_ttag(s, LIBAVFORMAT_IDENT, strlen(LIBAVFORMAT_IDENT) + 1, - MKBETAG('T', 'S', 'S', 'E')); - } cur_pos = url_ftell(s->pb); url_fseek(s->pb, size_pos, SEEK_SET); Modified: trunk/libavformat/utils.c ============================================================================== --- trunk/libavformat/utils.c Tue Feb 16 15:48:01 2010 (r21849) +++ trunk/libavformat/utils.c Tue Feb 16 17:32:25 2010 (r21850) @@ -2583,6 +2583,20 @@ int av_write_header(AVFormatContext *s) ff_metadata_mux_compat(s); #endif + /* set muxer identification string */ + if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { + AVMetadata *m; + AVMetadataTag *t; + + if (!(m = av_mallocz(sizeof(AVMetadata)))) + return AVERROR(ENOMEM); + av_metadata_set2(&m, "encoder", LIBAVFORMAT_IDENT, 0); + metadata_conv(&m, s->oformat->metadata_conv, NULL); + if ((t = av_metadata_get(m, "", NULL, AV_METADATA_IGNORE_SUFFIX))) + av_metadata_set2(&s->metadata, t->key, t->value, 0); + av_metadata_free(&m); + } + if(s->oformat->write_header){ ret = s->oformat->write_header(s); if (ret < 0)
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers.
What are the chances of getting this reverted? I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. This means that the encoder tag is redundant. I would also argue that it is wrong because libavcodec is the encoder.
Hi, On Tue, Feb 23, 2010 at 8:38 PM, James Darnley <james.darnley at gmail.com> wrote:
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers.
What are the chances of getting this reverted? ?I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. ?This means that the encoder tag is redundant. ?I would also argue that it is wrong because libavcodec is the encoder.
Can you amend it to not double-write it? Or please discuss on ffmpeg-devel, the person who wrote this patch might not be on cvslog (since he does not have a SVN account). Ronald
James Darnley wrote:
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers.
What are the chances of getting this reverted? I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. This means that the encoder tag is redundant. I would also argue that it is wrong because libavcodec is the encoder.
Justin Ruggles <justin.ruggles at gmail.com> writes:
James Darnley wrote:
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers.
What are the chances of getting this reverted? I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. This means that the encoder tag is redundant. I would also argue that it is wrong because libavcodec is the encoder.
From Xiph.org VorbisComment recommendations: http://wiki.xiph.org/index.php/VorbisComment#ENCODER
- The vendor string is usually used to store the name and version of the underlying codec library - The idea of ENCODER is to store the name of the user-visible application, for example ffmpeg2theora.
I wouldn't trust an organisation that can't distinguish between containers and codecs on this matter.
They also recommend using a URL in the ENCODER tag.
Which their own software doesn't do. -- M?ns Rullg?rd mans at mansr.com
M?ns Rullg?rd wrote:
Justin Ruggles <justin.ruggles at gmail.com> writes:
James Darnley wrote:
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers. What are the chances of getting this reverted? I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. This means that the encoder tag is redundant. I would also argue that it is wrong because libavcodec is the encoder. From Xiph.org VorbisComment recommendations: http://wiki.xiph.org/index.php/VorbisComment#ENCODER
- The vendor string is usually used to store the name and version of the underlying codec library - The idea of ENCODER is to store the name of the user-visible application, for example ffmpeg2theora.
I wouldn't trust an organisation that can't distinguish between containers and codecs on this matter.
They also recommend using a URL in the ENCODER tag.
Which their own software doesn't do.
We're all just a bunch of Ogg-hating wankers, says Monty of Xiph: http://blog.gingertech.net/2010/02/20/googles-challenges-of-freeing-vp8/#com... :) -- -Mike Melanson
On Wed, Feb 24, 2010 at 09:58:45PM -0800, Mike Melanson wrote:
M?ns Rullg?rd wrote:
Justin Ruggles <justin.ruggles at gmail.com> writes:
James Darnley wrote:
On 16 February 2010 17:32, rbultje <subversion at mplayerhq.hu> wrote:
Log: Set lavf identification string globally in av_write_header(), rather than inside the muxers. Remove special handling of "encoder" tags from AVI and MP3 muxers. What are the chances of getting this reverted? I ask because my "flac tags" patch already writes the LIBAVFORMAT_IDENT string in the VorbisComment as the vendor_string. This means that the encoder tag is redundant. I would also argue that it is wrong because libavcodec is the encoder. From Xiph.org VorbisComment recommendations: http://wiki.xiph.org/index.php/VorbisComment#ENCODER
- The vendor string is usually used to store the name and version of the underlying codec library - The idea of ENCODER is to store the name of the user-visible application, for example ffmpeg2theora.
I wouldn't trust an organisation that can't distinguish between containers and codecs on this matter.
They also recommend using a URL in the ENCODER tag.
Which their own software doesn't do.
We're all just a bunch of Ogg-hating wankers, says Monty of Xiph:
http://blog.gingertech.net/2010/02/20/googles-challenges-of-freeing-vp8/#com...
He's definitely right on the Ogg-hating part. However that a software developer refuses to see that needless dependencies between already large software (demuxer and decoder) is a rather bad thing is quite scary to me.
participants (7)
-
james.darnley@gmail.com -
justin.ruggles@gmail.com -
mans@mansr.com -
mike@multimedia.cx -
Reimar.Doeffinger@gmx.de -
rsbultje@gmail.com -
subversion@mplayerhq.hu