Commit 9f4f5787 authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov Committed by Michael Niedermayer

aacenc: reset marked IS and M/S bands upon frame encoding

This commit resets any bands marked as M/S or IS upon encoding a frame.
This is needed because the arrays may contain some residual information
upon allocation on startup and because there isn't any mechanism to
reset the arrays once the frame has been encoded.
Reviewed-by: 's avatarClaudio Freire <klaussfreire@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 57848ef3
......@@ -617,6 +617,8 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
memset(cpe->is_mask, 0, sizeof(cpe->is_mask));
memset(cpe->ms_mask, 0, sizeof(cpe->ms_mask));
put_bits(&s->pb, 3, tag);
put_bits(&s->pb, 4, chan_el_counter[tag]++);
for (ch = 0; ch < chans; ch++)
......
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