aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-02-16 16:32:25 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-02-16 16:32:25 +0000
commited7694d8cf4633da444237f4df7efc48936419d2 (patch)
tree6ceaa52216a94a3914e7978a8dc0f365e68458c7 /libavformat/utils.c
parent114315994bc08812eeef51eaace455d86b5098d5 (diff)
downloadffmpeg-ed7694d8cf4633da444237f4df7efc48936419d2.tar.gz
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>. Originally committed as revision 21850 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4829446312..e01c26712d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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)