1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

* 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
This commit is contained in:
Philip Gladstone 2002-06-05 02:18:17 +00:00
parent 2ac887bae9
commit 084fada8d1

View 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++) {