aboutsummaryrefslogtreecommitdiff
path: root/libavformat/wav.c
diff options
context:
space:
mode:
authorMichael Niedermayer2004-09-22 20:01:56 +0000
committerMichael Niedermayer2004-09-22 20:01:56 +0000
commitc4f8d5d9f9001b7ece7f89fc756cf386f92528a4 (patch)
treec6736c6175028c0a94b8c873b562c37b7e5188f4 /libavformat/wav.c
parenta42c7b07aeb9f4a73b88269d5838e44d9c5904a2 (diff)
write shorter headers if possible
Originally committed as revision 3494 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/wav.c')
-rw-r--r--libavformat/wav.c4
1 files changed, 3 insertions, 1 deletions
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;