diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-03-08 11:21:33 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-03-08 11:21:33 +0000 |
commit | 952c69c479254496641014f03a51ed0cfd126c1d (patch) | |
tree | db9443e66ccc98a28a929106833f1b9fbaf6dabc /libavformat/avienc.c | |
parent | b559b29b1f9a8ce38f6d23fa4740b74bd5566bd5 (diff) | |
download | ffmpeg-952c69c479254496641014f03a51ed0cfd126c1d.tar.gz |
huffyuv encoding fixed
Originally committed as revision 1647 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r-- | libavformat/avienc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 04bc9e6964..19e336bead 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -129,11 +129,12 @@ unsigned int codec_get_bmp_tag(int id) /* BITMAPINFOHEADER header */ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf) { - put_le32(pb, 40); /* size */ + put_le32(pb, 40 + enc->extradata_size); /* size */ put_le32(pb, enc->width); put_le32(pb, enc->height); put_le16(pb, 1); /* planes */ - put_le16(pb, 24); /* depth */ + + put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */ /* compression type */ put_le32(pb, for_asf ? codec_get_asf_tag(tags, enc->codec_id) : codec_get_tag(tags, enc->codec_id)); put_le32(pb, enc->width * enc->height * 3); @@ -141,6 +142,11 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags put_le32(pb, 0); put_le32(pb, 0); put_le32(pb, 0); + + put_buffer(pb, enc->extradata, enc->extradata_size); + + if (enc->extradata_size & 1) + put_byte(pb, 0); } static void parse_specific_params(AVCodecContext *stream, int *au_byterate, int *au_ssize, int *au_scale) |