summaryrefslogtreecommitdiff
path: root/libav
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2002-07-22 01:44:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-07-22 01:44:08 +0000
commit889c522492040cb4098db7b97d09af17bd3f4a01 (patch)
treeed2fda4cf1ce2d1ec445f8fbfa1eae8ce6b8a0c4 /libav
parent27a5e8b897e27a8d6d4a9073d5226671ef30f1e8 (diff)
adpcm encoding patch by François Revol <revol at free dot fr>
Originally committed as revision 785 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav')
-rw-r--r--libav/wav.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libav/wav.c b/libav/wav.c
index b8946cf7a9..9e3d9ef0bb 100644
--- a/libav/wav.c
+++ b/libav/wav.c
@@ -51,6 +51,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
bps = 8;
} else if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME) {
bps = 0;
+ } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || enc->codec_id == CODEC_ID_ADPCM_MS) {
+ bps = 4;
} else {
bps = 16;
}
@@ -90,6 +92,9 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
put_le16(pb, 16); /* fwHeadFlags */
put_le32(pb, 0); /* dwPTSLow */
put_le32(pb, 0); /* dwPTSHigh */
+ } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) {
+ put_le16(pb, 2); /* wav_extra_size */
+ put_le16(pb, ((enc->block_align - 4 * enc->channels) / (4 * enc->channels)) * 8 + 1); /* wSamplesPerBlock */
} else
put_le16(pb, 0); /* wav_extra_size */