changeset 5371:74680ec68fd1 libavcodec

Set the step index correctly for flash adpcm. Patch by Baptiste Coudurier.
author banan
date Wed, 18 Jul 2007 18:40:03 +0000
parents bbb982818ce7
children 04a9bb415804
files adpcm.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/adpcm.c	Wed Jul 18 18:35:03 2007 +0000
+++ b/adpcm.c	Wed Jul 18 18:40:03 2007 +0000
@@ -531,8 +531,9 @@
 
         //Init the encoder state
         for(i=0; i<avctx->channels; i++){
+            c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63); // clip step so it fits 6 bits
             put_bits(&pb, 16, samples[i] & 0xFFFF);
-            put_bits(&pb, 6, c->status[i].step_index & 0x3F);
+            put_bits(&pb, 6, c->status[i].step_index);
             c->status[i].prev_sample = (signed short)samples[i];
         }