summaryrefslogtreecommitdiff
path: root/libavcodec/dstdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-13 20:41:45 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-02-14 16:29:23 +0100
commit34a6a36844887580f0dcc5badd640bae837b217b (patch)
tree6aea4bbc153bf024ce8e07dadca1aad0774b2e41 /libavcodec/dstdec.c
parentc2c65d1d1f3f7c53cc9f8695b8256f3ff4264ac4 (diff)
avcodec/dstdec: Use local channels variable
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dstdec.c')
-rw-r--r--libavcodec/dstdec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 880b838b0c..bdabced823 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -262,7 +262,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
skip_bits1(gb);
if (get_bits(gb, 6))
return AVERROR_INVALIDDATA;
- memcpy(frame->data[0], avpkt->data + 1, FFMIN(avpkt->size - 1, frame->nb_samples * avctx->channels));
+ memcpy(frame->data[0], avpkt->data + 1, FFMIN(avpkt->size - 1, frame->nb_samples * channels));
goto dsd;
}
@@ -287,7 +287,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
same_map = get_bits1(gb);
- if ((ret = read_map(gb, &s->fsets, map_ch_to_felem, avctx->channels)) < 0)
+ if ((ret = read_map(gb, &s->fsets, map_ch_to_felem, channels)) < 0)
return ret;
if (same_map) {
@@ -295,13 +295,13 @@ static int decode_frame(AVCodecContext *avctx, void *data,
memcpy(map_ch_to_pelem, map_ch_to_felem, sizeof(map_ch_to_felem));
} else {
avpriv_request_sample(avctx, "Not Same Mapping");
- if ((ret = read_map(gb, &s->probs, map_ch_to_pelem, avctx->channels)) < 0)
+ if ((ret = read_map(gb, &s->probs, map_ch_to_pelem, channels)) < 0)
return ret;
}
/* Half Probability (10.10) */
- for (ch = 0; ch < avctx->channels; ch++)
+ for (ch = 0; ch < channels; ch++)
half_prob[ch] = get_bits1(gb);
/* Filter Coef Sets (10.12) */
@@ -325,7 +325,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
build_filter(s->filter, &s->fsets);
memset(s->status, 0xAA, sizeof(s->status));
- memset(dsd, 0, frame->nb_samples * 4 * avctx->channels);
+ memset(dsd, 0, frame->nb_samples * 4 * channels);
ac_get(ac, gb, prob_dst_x_bit(s->fsets.coeff[0][0]), &dst_x_bit);
@@ -364,10 +364,10 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
dsd:
- for (i = 0; i < avctx->channels; i++) {
+ for (i = 0; i < channels; i++) {
ff_dsd2pcm_translate(&s->dsdctx[i], frame->nb_samples, 0,
frame->data[0] + i * 4,
- avctx->channels * 4, pcm + i, avctx->channels);
+ channels * 4, pcm + i, channels);
}
*got_frame_ptr = 1;