]> git.sesse.net Git - mlt/commitdiff
Write metadata if there is any
authorj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 22 Jan 2007 18:30:56 +0000 (18:30 +0000)
committerj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 22 Jan 2007 18:30:56 +0000 (18:30 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@947 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/avformat/consumer_avformat.c

index 04cfde15147888fb1e80751ab60fffcdb6dcbc7c..21242c665cbea2d123cd622e20f352d2f7108ddd 100644 (file)
@@ -736,6 +736,32 @@ static void *consumer_thread( void *arg )
        }
 
        // Update the output context
+
+       // Write metadata
+       char *tmp = NULL;
+       int metavalue;
+
+       tmp = mlt_properties_get( properties, "meta.attr.title.markup");
+       if (tmp != NULL) snprintf( oc->title, sizeof(oc->title), "%s", tmp );
+
+       tmp = mlt_properties_get( properties, "meta.attr.comment.markup");
+       if (tmp != NULL) snprintf( oc->comment, sizeof(oc->comment), "%s", tmp );
+
+       tmp = mlt_properties_get( properties, "meta.attr.author.markup");
+       if (tmp != NULL) snprintf( oc->author, sizeof(oc->author), "%s", tmp );
+
+       tmp = mlt_properties_get( properties, "meta.attr.copyright.markup");
+       if (tmp != NULL) snprintf( oc->copyright, sizeof(oc->copyright), "%s", tmp );
+
+       tmp = mlt_properties_get( properties, "meta.attr.album.markup");
+       if (tmp != NULL) snprintf( oc->album, sizeof(oc->album), "%s", tmp );
+
+       metavalue = mlt_properties_get_int( properties, "meta.attr.year.markup");
+       if (metavalue != 0) oc->year = metavalue;
+
+       metavalue = mlt_properties_get_int( properties, "meta.attr.track.markup");
+       if (metavalue != 0) oc->track = metavalue;
+
        oc->oformat = fmt;
        snprintf( oc->filename, sizeof(oc->filename), "%s", filename );