Browse Source

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
tags/v0.5
Vladimir Voroshilov 18 years ago
parent
commit
330194b9ce
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      libavcodec/adpcm.c

+ 2
- 4
libavcodec/adpcm.c View File

@@ -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;


Loading…
Cancel
Save