summaryrefslogtreecommitdiff
path: root/libavformat/riffenc.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2013-12-23 20:37:00 +1100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-23 15:42:35 +0100
commitfcbb94712d9873a37cdc8b526e368154b5982186 (patch)
tree9b723a06bb82b22b0bac66cdf7aef11f1a25cb98 /libavformat/riffenc.c
parentd08ea75a825a8091e995a8e0d7c415ccc4339ec9 (diff)
riffenc: add option to ff_put_bmp_header to ignore extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riffenc.c')
-rw-r--r--libavformat/riffenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index bcfe018f74..d7cf846413 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -201,10 +201,10 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
/* BITMAPINFOHEADER header */
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
- const AVCodecTag *tags, int for_asf)
+ const AVCodecTag *tags, int for_asf, int ignore_extradata)
{
/* size */
- avio_wl32(pb, 40 + enc->extradata_size);
+ avio_wl32(pb, 40 + (ignore_extradata ? 0 : enc->extradata_size));
avio_wl32(pb, enc->width);
//We always store RGB TopDown
avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
@@ -220,10 +220,12 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
avio_wl32(pb, 0);
avio_wl32(pb, 0);
+ if (!ignore_extradata) {
avio_write(pb, enc->extradata, enc->extradata_size);
if (!for_asf && enc->extradata_size & 1)
avio_w8(pb, 0);
+ }
}
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate,