diff options
Diffstat (limited to 'libavformat/wav.c')
-rw-r--r-- | libavformat/wav.c | 4 |
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; |