summaryrefslogtreecommitdiff
path: root/libavcodec/wmalosslessdec.c
diff options
context:
space:
mode:
authorJakub Stachowski <qbast@go2.pl>2012-04-11 23:36:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-12 12:41:53 +0200
commit3b00fd5985c3ddffe7f66f72dcaa13b478fc7459 (patch)
tree79349ced22c5ba3d0036d8a26f6468d62161d5ff /libavcodec/wmalosslessdec.c
parent9e938d22c547654fcc19864f568288342ae2f3be (diff)
wmalosslessdec: Reset residues to 0 if they were not decoded from bitstream.
If channel residues are have not been decoded from bitstream, they should be initialized to 0 instead of using values from previous subframe. This causes bursts of noise in silent parts of some files. This patch fixes bug #1055 Reviewed-by: Benjamin Larsson <benjamin@southpole.se> Reviewed-by: Mashiat Sarker Shakkhar <mashiat.sarker@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-rw-r--r--libavcodec/wmalosslessdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index ab7af9552c..e5114436e6 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -955,7 +955,8 @@ static int decode_subframe(WmallDecodeCtx *s)
else
use_normal_update_speed(s, i);
revert_cdlms(s, i, 0, subframe_len);
- }
+ } else
+ memset(s->channel_residues, 0, sizeof(s->channel_residues));
}
if (s->do_mclms)
revert_mclms(s, subframe_len);