comparison asf.c @ 196:01bec1059bdf libavformat

use codec_tag for encoding too
author michaelni
date Mon, 18 Aug 2003 09:20:02 +0000
parents 6c9d6422a2f6
children eb90c0a5a1ba
comparison
equal deleted inserted replaced
195:0edf7458da7b 196:01bec1059bdf
409 p = avcodec_find_encoder(enc->codec_id); 409 p = avcodec_find_encoder(enc->codec_id);
410 410
411 put_le16(pb, asf->streams[n].num); 411 put_le16(pb, asf->streams[n].num);
412 put_str16(pb, p ? p->name : enc->codec_name); 412 put_str16(pb, p ? p->name : enc->codec_name);
413 put_le16(pb, 0); /* no parameters */ 413 put_le16(pb, 0); /* no parameters */
414
415
414 /* id */ 416 /* id */
415 if (enc->codec_type == CODEC_TYPE_AUDIO) { 417 if (enc->codec_type == CODEC_TYPE_AUDIO) {
416 put_le16(pb, 2); 418 put_le16(pb, 2);
417 put_le16(pb, codec_get_tag(codec_wav_tags, enc->codec_id)); 419 if(!enc->codec_tag)
420 enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id);
421 if(!enc->codec_tag)
422 return -1;
423 put_le16(pb, enc->codec_tag);
418 } else { 424 } else {
419 put_le16(pb, 4); 425 put_le16(pb, 4);
420 put_le32(pb, codec_get_tag(codec_bmp_tags, enc->codec_id)); 426 if(!enc->codec_tag)
427 enc->codec_tag = codec_get_tag(codec_bmp_tags, enc->codec_id);
428 if(!enc->codec_tag)
429 return -1;
430 put_le32(pb, enc->codec_tag);
421 } 431 }
422 } 432 }
423 end_header(pb, hpos); 433 end_header(pb, hpos);
424 434
425 /* patch the header size fields */ 435 /* patch the header size fields */