[FFmpeg-cvslog] r21644 - trunk/libavformat/avienc.c

michael subversion
Fri Feb 5 16:14:56 CET 2010


Author: michael
Date: Fri Feb  5 16:14:56 2010
New Revision: 21644

Log:
strn muxing in avi support.
untested as ffmpeg.c has no means to set AVStream metadata (patchwelcome)

Modified:
   trunk/libavformat/avienc.c

Modified: trunk/libavformat/avienc.c
==============================================================================
--- trunk/libavformat/avienc.c	Fri Feb  5 13:16:59 2010	(r21643)
+++ trunk/libavformat/avienc.c	Fri Feb  5 16:14:56 2010	(r21644)
@@ -114,11 +114,18 @@ static void avi_write_info_tag(ByteIOCon
     }
 }
 
-static void avi_write_info_tag2(AVFormatContext *s, const char *fourcc, const char *key1, const char *key2)
+static void avi_write_info_tag2(AVFormatContext *s, AVStream *st, const char *fourcc, const char *key1, const char *key2)
 {
-    AVMetadataTag *tag= av_metadata_get(s->metadata, key1, NULL, 0);
+    AVMetadataTag *tag;
+    if(st){
+        tag= av_metadata_get(st->metadata, key1, NULL, 0);
+        if(!tag && key2)
+            tag= av_metadata_get(st->metadata, key2, NULL, 0);
+    }else{
+        tag= av_metadata_get(s->metadata, key1, NULL, 0);
     if(!tag && key2)
         tag= av_metadata_get(s->metadata, key2, NULL, 0);
+    }
     if(tag)
         avi_write_info_tag(s->pb, fourcc, tag->value);
 }
@@ -294,6 +301,7 @@ static int avi_write_header(AVFormatCont
             return -1;
         }
         ff_end_tag(pb, strf);
+        avi_write_info_tag2(s, s->streams[i], "strn", "Title", "Description");
       }
 
         if (!url_is_streamed(pb)) {
@@ -370,13 +378,13 @@ static int avi_write_header(AVFormatCont
 
     list2 = ff_start_tag(pb, "LIST");
     put_tag(pb, "INFO");
-    avi_write_info_tag2(s, "INAM", "Title", NULL);
-    avi_write_info_tag2(s, "IART", "Artist", "Author");
-    avi_write_info_tag2(s, "ICOP", "Copyright", NULL);
-    avi_write_info_tag2(s, "ICMT", "Comment", NULL);
-    avi_write_info_tag2(s, "IPRD", "Album", NULL);
-    avi_write_info_tag2(s, "IGNR", "Genre", NULL);
-    avi_write_info_tag2(s, "IPRT", "Track", NULL);
+    avi_write_info_tag2(s, NULL, "INAM", "Title", NULL);
+    avi_write_info_tag2(s, NULL, "IART", "Artist", "Author");
+    avi_write_info_tag2(s, NULL, "ICOP", "Copyright", NULL);
+    avi_write_info_tag2(s, NULL, "ICMT", "Comment", NULL);
+    avi_write_info_tag2(s, NULL, "IPRD", "Album", NULL);
+    avi_write_info_tag2(s, NULL, "IGNR", "Genre", NULL);
+    avi_write_info_tag2(s, NULL, "IPRT", "Track", NULL);
     if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
         avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT);
     ff_end_tag(pb, list2);



More information about the ffmpeg-cvslog mailing list