diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-08-18 09:20:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-08-18 09:20:02 +0000 |
commit | bd5a60201e0fc253d55cef919a6d69de6efcbd1a (patch) | |
tree | 0486ceb8fe35878801d283c80da1e360e8e1bb29 /libavformat/asf.c | |
parent | f8188626331ba132abc7b11aadb15eaac09ac7aa (diff) | |
download | ffmpeg-bd5a60201e0fc253d55cef919a6d69de6efcbd1a.tar.gz |
use codec_tag for encoding too
Originally committed as revision 2125 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r-- | libavformat/asf.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c index 1712f8f22d..c05f28e35e 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -411,13 +411,23 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data put_le16(pb, asf->streams[n].num); put_str16(pb, p ? p->name : enc->codec_name); put_le16(pb, 0); /* no parameters */ + + /* id */ if (enc->codec_type == CODEC_TYPE_AUDIO) { put_le16(pb, 2); - put_le16(pb, codec_get_tag(codec_wav_tags, enc->codec_id)); + if(!enc->codec_tag) + enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id); + if(!enc->codec_tag) + return -1; + put_le16(pb, enc->codec_tag); } else { put_le16(pb, 4); - put_le32(pb, codec_get_tag(codec_bmp_tags, enc->codec_id)); + if(!enc->codec_tag) + enc->codec_tag = codec_get_tag(codec_bmp_tags, enc->codec_id); + if(!enc->codec_tag) + return -1; + put_le32(pb, enc->codec_tag); } } end_header(pb, hpos); |