From 889c522492040cb4098db7b97d09af17bd3f4a01 Mon Sep 17 00:00:00 2001 From: François Revol Date: Mon, 22 Jul 2002 01:44:08 +0000 Subject: adpcm encoding patch by François Revol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 785 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libav/wav.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libav') 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 */ -- cgit v1.2.3