From 83155daccd3c33663ebf419315142c2d26bb59cf Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 9 Dec 2016 00:22:57 +0100 Subject: [PATCH] wmadec: Remove two pointless variables. The local variables n and incr of wma_decode_frame() shadow the values of their counterparts in struct private_wmadec_data, and they remain constant within the function. Referring directly to the private structure instead makes the code shorter and improves readability. --- wmadec_filter.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wmadec_filter.c b/wmadec_filter.c index cb366057..31a13c50 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -1028,7 +1028,7 @@ static inline int16_t av_clip_int16(int a) /* Decode a frame of frame_len samples. */ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples) { - int ret, i, n, ch, incr; + int ret, i, ch; int16_t *ptr; float *iptr; @@ -1043,15 +1043,13 @@ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples) } /* convert frame to integer */ - n = pwd->frame_len; - incr = pwd->ahi.channels; for (ch = 0; ch < pwd->ahi.channels; ch++) { ptr = samples + ch; iptr = pwd->frame_out[ch]; - for (i = 0; i < n; i++) { + for (i = 0; i < pwd->frame_len; i++) { *ptr = av_clip_int16(lrintf(*iptr++)); - ptr += incr; + ptr += pwd->ahi.channels; } /* prepare for next block */ memmove(&pwd->frame_out[ch][0], &pwd->frame_out[ch][pwd->frame_len], -- 2.39.5