diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-07-02 19:13:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-07-03 16:17:16 +0200 |
commit | 9f4f5787046dd1430ebb5b58e49af32e304852af (patch) | |
tree | 952a8ae325baef06e00a18c21b47c7ca88d04fd4 | |
parent | 57848ef3c6a135caeb1f8034cadc157a38947009 (diff) | |
download | ffmpeg-9f4f5787046dd1430ebb5b58e49af32e304852af.tar.gz |
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: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/aacenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 3a512ffeee..05a8162394 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -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++) |