diff utils.c @ 5661:6d530eb42996 libavformat

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>.
author rbultje
date Tue, 16 Feb 2010 16:32:25 +0000
parents 25eca7e2cf64
children 7b939c780afc
line wrap: on
line diff
--- a/utils.c	Tue Feb 16 09:55:56 2010 +0000
+++ b/utils.c	Tue Feb 16 16:32:25 2010 +0000
@@ -2583,6 +2583,20 @@
     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)