diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-27 13:41:02 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-29 16:43:40 -0400 |
commit | 859bdc33e4c7b0bbb7a549df484b99e341dec074 (patch) | |
tree | ccd8a00511d53c94380145cd6e26ed19256edf3b | |
parent | 64e19ba48b6240828680a0a1cc506bdba7d98ad7 (diff) | |
download | ffmpeg-859bdc33e4c7b0bbb7a549df484b99e341dec074.tar.gz |
cin audio: use local variable for delta value
-rw-r--r-- | libavcodec/dsicinav.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index cafcaa7719..245b569433 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -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; |