mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 22:10:34 +00:00
Fix an underflow/overflow that was causing some crackles when playing
certain THP files. patch by Marco Gerards, mgerards xs4all nl Originally committed as revision 8703 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
44942d52b6
commit
e457023a95
@ -1359,8 +1359,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
|
||||
if(n&1) sampledat= *src++ <<28;
|
||||
else sampledat= (*src&0xF0)<<24;
|
||||
|
||||
*samples = ((prev[ch][0]*factor1
|
||||
sampledat = ((prev[ch][0]*factor1
|
||||
+ prev[ch][1]*factor2) >> 11) + (sampledat>>exp);
|
||||
CLAMP_TO_SHORT(sampledat);
|
||||
*samples = sampledat;
|
||||
prev[ch][1] = prev[ch][0];
|
||||
prev[ch][0] = *samples++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user