OSDN Git Service

* Add the comment block if any of the comment fields are present.
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Wed, 5 Jun 2002 02:18:17 +0000 (02:18 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Wed, 5 Jun 2002 02:18:17 +0000 (02:18 +0000)
* Eliminate compiler warning
* Add the codec name if we have it

Originally committed as revision 664 to svn://svn.ffmpeg.org/ffmpeg/trunk

libav/asf.c

index 66cae8d..a536549 100644 (file)
@@ -237,7 +237,7 @@ static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chu
     INT64 header_offset, cur_pos, hpos;
     int bit_rate;
 
-    has_title = (s->title[0] != '\0');
+    has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]);
 
     bit_rate = 0;
     for(n=0;n<s->nb_streams;n++) {
@@ -372,10 +372,13 @@ static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chu
     put_guid(pb, &codec_comment1_header);
     put_le32(pb, s->nb_streams);
     for(n=0;n<s->nb_streams;n++) {
+        AVCodec *p;
+
         enc = &s->streams[n]->codec;
+        p = avcodec_find_encoder(enc->codec_id);
 
         put_le16(pb, asf->streams[n].num);
-        put_str16(pb, enc->codec_name);
+        put_str16(pb, p ? p->name : enc->codec_name);
         put_le16(pb, 0); /* no parameters */
         /* id */
         if (enc->codec_type == CODEC_TYPE_AUDIO) {
@@ -1017,7 +1020,7 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int asf_read_close(AVFormatContext *s)
 {
-    ASFContext *asf = s->priv_data;
+    //ASFContext *asf = s->priv_data;
     int i;
 
     for(i=0;i<s->nb_streams;i++) {