From c4f8d5d9f9001b7ece7f89fc756cf386f92528a4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 22 Sep 2004 20:01:56 +0000 Subject: write shorter headers if possible Originally committed as revision 3494 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/wav.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat/wav.c') diff --git a/libavformat/wav.c b/libavformat/wav.c index 7ac0d879b1..e0f134b47f 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -107,7 +107,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) put_le16(pb, 2); /* wav_extra_size */ hdrsize += 2; put_le16(pb, ((enc->block_align - 4 * enc->channels) / (4 * enc->channels)) * 8 + 1); /* wSamplesPerBlock */ - } else { + } else if(enc->extradata_size){ put_le16(pb, enc->extradata_size); put_buffer(pb, enc->extradata, enc->extradata_size); hdrsize += enc->extradata_size; @@ -115,6 +115,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) hdrsize++; put_byte(pb, 0); } + } else { + hdrsize -= 2; } return hdrsize; -- cgit v1.2.3