[FFmpeg-cvslog] r17653 - trunk/libavformat/nutenc.c

aurel subversion
Sat Feb 28 00:12:15 CET 2009


Author: aurel
Date: Sat Feb 28 00:12:14 2009
New Revision: 17653

Log:
use new metadata API in nut muxer
This is only a straight conversion of current code, so for now, it won't
mux generic metadata. It will only mux Title, Author and Copyright.

Modified:
   trunk/libavformat/nutenc.c

Modified: trunk/libavformat/nutenc.c
==============================================================================
--- trunk/libavformat/nutenc.c	Sat Feb 28 00:10:34 2009	(r17652)
+++ trunk/libavformat/nutenc.c	Sat Feb 28 00:12:14 2009	(r17653)
@@ -448,6 +448,7 @@ static int add_info(ByteIOContext *bc, c
 
 static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){
     AVFormatContext *s= nut->avf;
+    AVMetadataTag *title, *author, *copyright;
     ByteIOContext *dyn_bc;
     uint8_t *dyn_buf=NULL;
     int count=0, dyn_size;
@@ -455,9 +456,13 @@ static int write_globalinfo(NUTContext *
     if(ret < 0)
         return ret;
 
-    if(s->title    [0]) count+= add_info(dyn_bc, "Title"    , s->title);
-    if(s->author   [0]) count+= add_info(dyn_bc, "Author"   , s->author);
-    if(s->copyright[0]) count+= add_info(dyn_bc, "Copyright", s->copyright);
+    title     = av_metadata_get(s->metadata, "Title"    , NULL, 0);
+    author    = av_metadata_get(s->metadata, "Author"   , NULL, 0);
+    copyright = av_metadata_get(s->metadata, "Copyright", NULL, 0);
+
+    if(title    ) count+= add_info(dyn_bc, "Title"    , title->value);
+    if(author   ) count+= add_info(dyn_bc, "Author"   , author->value);
+    if(copyright) count+= add_info(dyn_bc, "Copyright", copyright->value);
     if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
                         count+= add_info(dyn_bc, "Encoder"  , LIBAVFORMAT_IDENT);
 




More information about the ffmpeg-cvslog mailing list