Commit 859bdc33 authored by Justin Ruggles's avatar Justin Ruggles

cin audio: use local variable for delta value

parent 64e19ba4
......@@ -328,21 +328,24 @@ static int cinaudio_decode_frame(AVCodecContext *avctx,
CinAudioContext *cin = avctx->priv_data;
const uint8_t *src = buf;
int16_t *samples = data;
int delta;
buf_size = FFMIN(buf_size, *data_size/2);
delta = cin->delta;
if (cin->initial_decode_frame) {
cin->initial_decode_frame = 0;
cin->delta = (int16_t)AV_RL16(src); src += 2;
*samples++ = cin->delta;
delta = (int16_t)AV_RL16(src); src += 2;
*samples++ = delta;
buf_size -= 2;
}
while (buf_size > 0) {
cin->delta += cinaudio_delta16_table[*src++];
cin->delta = av_clip_int16(cin->delta);
*samples++ = cin->delta;
delta += cinaudio_delta16_table[*src++];
delta = av_clip_int16(delta);
*samples++ = delta;
--buf_size;
}
cin->delta = delta;
*data_size = (uint8_t *)samples - (uint8_t *)data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment