mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-13 19:01:03 +00:00
cin audio: use local variable for delta value
This commit is contained in:
parent
64e19ba48b
commit
859bdc33e4
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user