[FFmpeg-devel] [PATCH] fix clicks in ADPCM IMA AMV decoder
Wed Oct 3 20:01:53 CEST 2007
Vladimir Voroshilov wrote:
> 2007/10/3, Vitor Sessak <vitor1001 at gmail.com>:
> > Hi
> > Vladimir Voroshilov wrote:
> > > Hi, All
> > >
> > > Attached simle patches fixes clicks in audio when playing AMV files.
> > Cool. Is it still not loud enough?
> Hm. It is enough loud for me now.
> > >
> > > Index: libavcodec/adpcm.c
> > > ===================================================================
> > > --- libavcodec/adpcm.c (revision 10652)
> > > +++ libavcodec/adpcm.c (working copy)
> > > @@ -1184,7 +1184,7 @@
> > > break;
> > > case CODEC_ID_ADPCM_IMA_AMV:
> > > case CODEC_ID_ADPCM_IMA_SMJPEG:
> > > - c->status.predictor = *src;
> > > + c->status.predictor = (int16_t)AV_RL16(src);
> > > src += 2;
> > c->status.predictor = bytestream_get_le16(&src);
> I've made simple (imho) solution which also comply with other code style.
This new patch is not good. It could segfault on arch which requires strict
alignment if src is not properly aligned.
The solution proposed by Vitor is the right one, and it's simpler (it saves
you the src += 2).
BTW: I wonder if step_index shouldn't be read as an int16_t as well ?
More information about the ffmpeg-devel