diff options
author | Vladimir Voroshilov <voroshil@gmail.com> | 2007-10-03 19:32:57 +0000 |
---|---|---|
committer | Vladimir Voroshilov <voroshil@gmail.com> | 2007-10-03 19:32:57 +0000 |
commit | 330194b9cec1b31cd61a80d1914bc8cfc73ad45d (patch) | |
tree | f102e3f81a77e3becd50ac7c89c764a4b5569593 /libavcodec/adpcm.c | |
parent | ba869f6b25e04b2c1a6a9c7719306e29b7fc8be4 (diff) | |
download | ffmpeg-330194b9cec1b31cd61a80d1914bc8cfc73ad45d.tar.gz |
Fix audio clicks in ADPCM IMA AMV by casting predictor as "signed short"
Initialize step_index as int16_t (as multimedia wiki says).
Originally committed as revision 10657 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 0d1e0ecd55..21830ffb38 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1184,10 +1184,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, break; case CODEC_ID_ADPCM_IMA_AMV: case CODEC_ID_ADPCM_IMA_SMJPEG: - c->status[0].predictor = *src; - src += 2; - c->status[0].step_index = *src++; - src++; /* skip another byte before getting to the meat */ + c->status[0].predictor = (signed short)bytestream_get_le16(&src); + c->status[0].step_index = bytestream_get_le16(&src); if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) src+=4; |