# HG changeset patch # User michael # Date 1095883316 0 # Node ID 0b867ba5975395b1ab698f07acf2bb00e842ea5f # Parent 0f9b7efc444b894a0d959e0bf5bafd65b162ca48 write shorter headers if possible diff -r 0f9b7efc444b -r 0b867ba59753 wav.c --- a/wav.c Wed Sep 22 04:51:01 2004 +0000 +++ b/wav.c Wed Sep 22 20:01:56 2004 +0000 @@ -107,7 +107,7 @@ 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 @@ hdrsize++; put_byte(pb, 0); } + } else { + hdrsize -= 2; } return hdrsize;