diff options
author | François Revol <revol@free.fr> | 2002-07-22 01:44:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-07-22 01:44:08 +0000 |
commit | 889c522492040cb4098db7b97d09af17bd3f4a01 (patch) | |
tree | ed2fda4cf1ce2d1ec445f8fbfa1eae8ce6b8a0c4 /libav/wav.c | |
parent | 27a5e8b897e27a8d6d4a9073d5226671ef30f1e8 (diff) | |
download | ffmpeg-889c522492040cb4098db7b97d09af17bd3f4a01.tar.gz |
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/wav.c')
-rw-r--r-- | libav/wav.c | 5 |
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 */ |