summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@smartjog.com>2007-07-18 18:40:03 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2007-07-18 18:40:03 +0000
commitac0691071e3bd6b188ec324a5817937a35d5b5a8 (patch)
treede6b05abaf3cc21063a91d2183f70cacd9b038dc /libavcodec/adpcm.c
parent9fff16bcbb3c727c39823a39cfda1ce74d53227b (diff)
downloadffmpeg-ac0691071e3bd6b188ec324a5817937a35d5b5a8.tar.gz
Set the step index correctly for flash adpcm. Patch by Baptiste
Coudurier. Originally committed as revision 9743 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 5539cf9410..9111a7ac10 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -531,8 +531,9 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
//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];
}