[Ffmpeg-cvslog] r8703 - trunk/libavcodec/adpcm.c

diego subversion
Tue Apr 10 10:18:05 CEST 2007


Author: diego
Date: Tue Apr 10 10:18:04 2007
New Revision: 8703

Modified:
   trunk/libavcodec/adpcm.c

Log:
Fix an underflow/overflow that was causing some crackles when playing
certain THP files.
patch by Marco Gerards, mgerards xs4all nl


Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c	(original)
+++ trunk/libavcodec/adpcm.c	Tue Apr 10 10:18:04 2007
@@ -1359,8 +1359,10 @@ static int adpcm_decode_frame(AVCodecCon
                     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++;
 




More information about the ffmpeg-cvslog mailing list