diff options
author | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-06-05 02:18:17 +0000 |
---|---|---|
committer | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-06-05 02:18:17 +0000 |
commit | 084fada8d134116358f2c56a1452c4885646b416 (patch) | |
tree | d1e3a6411d1bf4782fa78c1ff49628396515a2aa /libav | |
parent | 2ac887bae915affcff2279d6c2fdb8a02481ebf6 (diff) | |
download | ffmpeg-084fada8d134116358f2c56a1452c4885646b416.tar.gz |
* Add the comment block if any of the comment fields are present.
* Eliminate compiler warning
* Add the codec name if we have it
Originally committed as revision 664 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav')
-rw-r--r-- | libav/asf.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libav/asf.c b/libav/asf.c index 66cae8dba6..a536549940 100644 --- a/libav/asf.c +++ b/libav/asf.c @@ -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++) { |